Class: DoDSClass
- Inherits:
-
Object
- Object
- DoDSClass
- Includes:
- GameClass
- Defined in:
- lib/steam/community/dods/dods_class.rb
Overview
Represents the stats for a Day of Defeat: Source class for a specific user
Instance Attribute Summary collapse
-
#blocks ⇒ Fixnum
readonly
Returns the blocks achieved by the player with this class.
-
#bombs_defused ⇒ Fixnum
readonly
Returns the bombs defused by the player with this class.
-
#bombs_planted ⇒ Fixnum
readonly
Returns the bombs planted by the player with this class.
-
#captures ⇒ Fixnum
readonly
Returns the number of points captured by the player with this class.
-
#deaths ⇒ Fixnum
readonly
Returns the number of times the player died with this class.
-
#dominations ⇒ Fixnum
readonly
Returns the dominations achieved by the player with this class.
-
#key ⇒ String
readonly
Returns the ID of this class.
-
#kills ⇒ Fixnum
readonly
Returns the number of enemies killed by the player with this class.
-
#revenges ⇒ Fixnum
readonly
Returns the revenges achieved by the player with this class.
-
#rounds_lost ⇒ Fixnum
readonly
Returns the number of rounds lost with this class.
-
#rounds_won ⇒ Fixnum
readonly
Returns the number of rounds won with this class.
Attributes included from GameClass
Instance Method Summary collapse
-
#initialize(class_data) ⇒ DoDSClass
constructor
Creates a new instance of a Day of Defeat: Source class based on the given XML data.
Constructor Details
#initialize(class_data) ⇒ DoDSClass
Creates a new instance of a Day of Defeat: Source class based on the given XML data
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/steam/community/dods/dods_class.rb', line 74 def initialize(class_data) @blocks = class_data['blocks'].to_i @bombs_defused = class_data['bombsdefused'].to_i @bombs_planted = class_data['bombsplanted'].to_i @captures = class_data['captures'].to_i @deaths = class_data['deaths'].to_i @dominations = class_data['dominations'].to_i @key = class_data['key'] @kills = class_data['kills'].to_i @name = class_data['name'] @play_time = class_data['playtime'].to_i @rounds_lost = class_data['roundslost'].to_i @rounds_won = class_data['roundswon'].to_i @revenges = class_data['revenges'].to_i end |
Instance Attribute Details
#blocks ⇒ Fixnum (readonly)
Returns the blocks achieved by the player with this class
18 19 20 |
# File 'lib/steam/community/dods/dods_class.rb', line 18 def blocks @blocks end |
#bombs_defused ⇒ Fixnum (readonly)
Returns the bombs defused by the player with this class
23 24 25 |
# File 'lib/steam/community/dods/dods_class.rb', line 23 def bombs_defused @bombs_defused end |
#bombs_planted ⇒ Fixnum (readonly)
Returns the bombs planted by the player with this class
28 29 30 |
# File 'lib/steam/community/dods/dods_class.rb', line 28 def bombs_planted @bombs_planted end |
#captures ⇒ Fixnum (readonly)
Returns the number of points captured by the player with this class
33 34 35 |
# File 'lib/steam/community/dods/dods_class.rb', line 33 def captures @captures end |
#deaths ⇒ Fixnum (readonly)
Returns the number of times the player died with this class
38 39 40 |
# File 'lib/steam/community/dods/dods_class.rb', line 38 def deaths @deaths end |
#dominations ⇒ Fixnum (readonly)
Returns the dominations achieved by the player with this class
43 44 45 |
# File 'lib/steam/community/dods/dods_class.rb', line 43 def dominations @dominations end |
#key ⇒ String (readonly)
Returns the ID of this class
48 49 50 |
# File 'lib/steam/community/dods/dods_class.rb', line 48 def key @key end |
#kills ⇒ Fixnum (readonly)
Returns the number of enemies killed by the player with this class
53 54 55 |
# File 'lib/steam/community/dods/dods_class.rb', line 53 def kills @kills end |
#revenges ⇒ Fixnum (readonly)
Returns the revenges achieved by the player with this class
63 64 65 |
# File 'lib/steam/community/dods/dods_class.rb', line 63 def revenges @revenges end |
#rounds_lost ⇒ Fixnum (readonly)
Returns the number of rounds lost with this class
58 59 60 |
# File 'lib/steam/community/dods/dods_class.rb', line 58 def rounds_lost @rounds_lost end |
#rounds_won ⇒ Fixnum (readonly)
Returns the number of rounds won with this class
68 69 70 |
# File 'lib/steam/community/dods/dods_class.rb', line 68 def rounds_won @rounds_won end |