Class: AlienSwarmWeapon
- Inherits:
-
Object
- Object
- AlienSwarmWeapon
- Includes:
- GameWeapon
- Defined in:
- lib/steam/community/alien_swarm/alien_swarm_weapon.rb
Overview
AlienSwarmWeapon holds statistical information about weapons used by a player in Alien Swarm.
Instance Attribute Summary collapse
-
#accuracy ⇒ Object
readonly
Returns the value of attribute accuracy.
-
#damage ⇒ Object
readonly
Returns the value of attribute damage.
-
#friendly_fire ⇒ Object
readonly
Returns the value of attribute friendly_fire.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#shots ⇒ Object
readonly
Returns the value of attribute shots.
Attributes included from GameWeapon
Instance Method Summary collapse
-
#initialize(weapon_data) ⇒ AlienSwarmWeapon
constructor
Creates a new instance of AlienSwarmWeapon based on the assigned weapon XML data.
Methods included from GameWeapon
Constructor Details
#initialize(weapon_data) ⇒ AlienSwarmWeapon
Creates a new instance of AlienSwarmWeapon based on the assigned weapon XML data
18 19 20 21 22 23 24 25 26 |
# File 'lib/steam/community/alien_swarm/alien_swarm_weapon.rb', line 18 def initialize(weapon_data) super @accuracy = weapon_data.elements['accuracy'].text.to_f @damage = weapon_data.elements['damage'].text.to_i @friendly_fire = weapon_data.elements['friendlyfire'].text.to_i @name = weapon_data.elements['name'].text @shots = weapon_data.elements['shotsfired'].text.to_i end |
Instance Attribute Details
#accuracy ⇒ Object (readonly)
Returns the value of attribute accuracy.
14 15 16 |
# File 'lib/steam/community/alien_swarm/alien_swarm_weapon.rb', line 14 def accuracy @accuracy end |
#damage ⇒ Object (readonly)
Returns the value of attribute damage.
14 15 16 |
# File 'lib/steam/community/alien_swarm/alien_swarm_weapon.rb', line 14 def damage @damage end |
#friendly_fire ⇒ Object (readonly)
Returns the value of attribute friendly_fire.
14 15 16 |
# File 'lib/steam/community/alien_swarm/alien_swarm_weapon.rb', line 14 def friendly_fire @friendly_fire end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/steam/community/alien_swarm/alien_swarm_weapon.rb', line 14 def name @name end |
#shots ⇒ Object (readonly)
Returns the value of attribute shots.
14 15 16 |
# File 'lib/steam/community/alien_swarm/alien_swarm_weapon.rb', line 14 def shots @shots end |