Class: TF2Class

Inherits:
Object
  • Object
show all
Includes:
GameClass
Defined in:
lib/steam/community/tf2/tf2_class.rb

Overview

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

Author:

  • Sebastian Staudt

Direct Known Subclasses

TF2Engineer, TF2Medic, TF2Sniper, TF2Spy

Instance Attribute Summary collapse

Attributes included from GameClass

#name, #play_time

Instance Method Summary collapse

Constructor Details

#initialize(class_data) ⇒ TF2Class

Creates a new TF2 class instance based on the assigned XML data

Parameters:

  • class_data (Hash<String, Object>)

    The XML data for this class



77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/steam/community/tf2/tf2_class.rb', line 77

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

Instance Attribute Details

#max_buildings_destroyedFixnum (readonly)

Returns the maximum number of buildings the player has destroyed in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of buildings destroyed



19
20
21
# File 'lib/steam/community/tf2/tf2_class.rb', line 19

def max_buildings_destroyed
  @max_buildings_destroyed
end

#max_capturesFixnum (readonly)

Returns the maximum number of points captured by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of points captured



25
26
27
# File 'lib/steam/community/tf2/tf2_class.rb', line 25

def max_captures
  @max_captures
end

#max_damageFixnum (readonly)

Returns the maximum damage dealt by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum damage dealt



31
32
33
# File 'lib/steam/community/tf2/tf2_class.rb', line 31

def max_damage
  @max_damage
end

#max_defensesFixnum (readonly)

Returns the maximum number of defenses by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of defenses



37
38
39
# File 'lib/steam/community/tf2/tf2_class.rb', line 37

def max_defenses
  @max_defenses
end

#max_dominationsFixnum (readonly)

Returns the maximum number of dominations by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of dominations



43
44
45
# File 'lib/steam/community/tf2/tf2_class.rb', line 43

def max_dominations
  @max_dominations
end

#max_kill_assistsFixnum (readonly)

Returns the maximum number of times the the player assisted a teammate with killing an enemy in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of kill assists



49
50
51
# File 'lib/steam/community/tf2/tf2_class.rb', line 49

def max_kill_assists
  @max_kill_assists
end

#max_killsFixnum (readonly)

Returns the maximum number of enemies killed by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of kills



55
56
57
# File 'lib/steam/community/tf2/tf2_class.rb', line 55

def max_kills
  @max_kills
end

#max_revengesFixnum (readonly)

Returns the maximum number of revenges by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum number of revenges



61
62
63
# File 'lib/steam/community/tf2/tf2_class.rb', line 61

def max_revenges
  @max_revenges
end

#max_scoreFixnum (readonly)

Returns the maximum number score achieved by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum score



67
68
69
# File 'lib/steam/community/tf2/tf2_class.rb', line 67

def max_score
  @max_score
end

#max_time_aliveFixnum (readonly)

Returns the maximum lifetime by the player in a single life with this class

Returns:

  • (Fixnum)

    Maximum lifetime



72
73
74
# File 'lib/steam/community/tf2/tf2_class.rb', line 72

def max_time_alive
  @max_time_alive
end