Class: TF2Spy

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

Overview

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

Author:

  • Sebastian Staudt

Instance Attribute Summary collapse

Attributes included from TF2Class

#max_buildings_destroyed, #max_captures, #max_damage, #max_defenses, #max_dominations, #max_kill_assists, #max_kills, #max_revenges, #max_score, #max_time_alive

Attributes included from GameClass

#name, #play_time

Instance Method Summary collapse

Constructor Details

#initialize(class_data) ⇒ TF2Spy

Creates a new instance of the Spy class based on the given XML data

Parameters:

  • class_data (REXML::Element)

    The XML data for this Spy



30
31
32
33
34
35
# File 'lib/steam/community/tf2/tf2_spy.rb', line 30

def initialize(class_data)
  super class_data

  @max_backstabs      = class_data.elements['ibackstabs'].text.to_i
  @max_health_leeched = class_data.elements['ihealthpointsleached'].text.to_i
end

Instance Attribute Details

#max_backstabsFixnum (readonly)

Returns the maximum number enemies killed with a backstab by the player in a single life as a Spy

Returns:

  • (Fixnum)

    Maximum number of buildings built



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

def max_backstabs
  @max_backstabs
end

#max_health_leechedFixnum (readonly)

Returns the maximum health leeched from enemies by the player in a single life as a Spy

Returns:

  • (Fixnum)

    Maximum health leeched



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

def max_health_leeched
  @max_health_leeched
end