Class: L4DExplosive
- Inherits:
-
Object
- Object
- L4DExplosive
- Includes:
- GameWeapon
- Defined in:
- lib/steam/community/l4d/l4d_explosive.rb
Overview
This class represents the statistics of a single explosive weapon for a user in Left4Dead
Instance Attribute Summary
Attributes included from GameWeapon
Instance Method Summary collapse
-
#avg_kills_per_shot ⇒ Float
Returns the average number of killed zombies for one shot of this explosive.
-
#initialize(weapon_name, weapon_data) ⇒ L4DExplosive
constructor
Creates a new instance of an explosivve based on the given XML data.
Methods included from GameWeapon
Constructor Details
#initialize(weapon_name, weapon_data) ⇒ L4DExplosive
Creates a new instance of an explosivve based on the given XML data
20 21 22 23 24 25 |
# File 'lib/steam/community/l4d/l4d_explosive.rb', line 20 def initialize(weapon_name, weapon_data) super weapon_data @id = weapon_name @shots = weapon_data['thrown'].to_i end |
Instance Method Details
#avg_kills_per_shot ⇒ Float
Returns the average number of killed zombies for one shot of this explosive
30 31 32 |
# File 'lib/steam/community/l4d/l4d_explosive.rb', line 30 def avg_kills_per_shot 1 / avg_shots_per_kill end |