Module: TF2Class

Includes:
GameClass
Included in:
TF2Engineer, TF2Medic, TF2Sniper, TF2Spy
Defined in:
lib/steam/community/tf2/tf2_class.rb

Overview

Represents the stats for a Team Fortress 2 class for a specific user

Instance Attribute Summary collapse

Attributes included from GameClass

#name, #play_time

Instance Method Summary collapse

Instance Attribute Details

#max_buildings_destroyedObject (readonly)

Returns the value of attribute max_buildings_destroyed.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_buildings_destroyed
  @max_buildings_destroyed
end

#max_capturesObject (readonly)

Returns the value of attribute max_captures.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_captures
  @max_captures
end

#max_damageObject (readonly)

Returns the value of attribute max_damage.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_damage
  @max_damage
end

#max_defensesObject (readonly)

Returns the value of attribute max_defenses.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_defenses
  @max_defenses
end

#max_dominationsObject (readonly)

Returns the value of attribute max_dominations.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_dominations
  @max_dominations
end

#max_kill_assistsObject (readonly)

Returns the value of attribute max_kill_assists.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_kill_assists
  @max_kill_assists
end

#max_killsObject (readonly)

Returns the value of attribute max_kills.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_kills
  @max_kills
end

#max_revengesObject (readonly)

Returns the value of attribute max_revenges.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_revenges
  @max_revenges
end

#max_scoreObject (readonly)

Returns the value of attribute max_score.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_score
  @max_score
end

#max_time_aliveObject (readonly)

Returns the value of attribute max_time_alive.



13
14
15
# File 'lib/steam/community/tf2/tf2_class.rb', line 13

def max_time_alive
  @max_time_alive
end

Instance Method Details

#initialize(class_data) ⇒ Object

Creates a new instance of TF2Class based on the assigned XML data



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/steam/community/tf2/tf2_class.rb', line 18

def initialize(class_data)
  @name                    = class_data.elements['className'].text
  @max_buildings_destroyed = class_data.elements['ibuildingsdestroyed'].text.to_i
  @max_captures            = class_data.elements['ipointcaptures'].text.to_i
  @max_damage              = class_data.elements['idamagedealt'].text.to_i
  @max_defenses            = class_data.elements['ipointdefenses'].text.to_i
  @max_dominations         = class_data.elements['idominations'].text.to_i
  @max_kill_assists        = class_data.elements['ikillassists'].text.to_i
  @max_kills               = class_data.elements['inumberofkills'].text.to_i
  @max_revenges            = class_data.elements['irevenge'].text.to_i
  @max_score               = class_data.elements['ipointsscored'].text.to_i
  @max_time_alive          = class_data.elements['iplaytime'].text.to_i
  @play_time               = class_data.elements['playtimeSeconds'].text.to_i
end