Class: TF2LineParser::Events::FirstHealAfterSpawn

Inherits:
Event
  • Object
show all
Defined in:
lib/tf2_line_parser/events/first_heal_after_spawn.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#airshot, #cap_name, #cap_number, #customkill, #healing, #item, #length, #message, #method, #role, #score, #target, #team, #type, #ubercharge, #unknown, #value, #weapon

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Event

parse_player_section, parse_target_section, #parse_time, regex_cap, regex_console, regex_message, regex_player, regex_results, regex_target, regex_time, time_format, types

Constructor Details

#initialize(time, name, uid, steam_id, team, heal_time) ⇒ FirstHealAfterSpawn

Returns a new instance of FirstHealAfterSpawn.



18
19
20
21
22
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 18

def initialize(time, name, uid, steam_id, team, heal_time)
  @time = parse_time(time)
  @player = Player.new(name, uid, steam_id, team)
  @heal_time = heal_time.to_f
end

Instance Attribute Details

#heal_timeObject (readonly)

Returns the value of attribute heal_time.



4
5
6
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 4

def heal_time
  @heal_time
end

#playerObject (readonly)

Returns the value of attribute player.



4
5
6
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 4

def player
  @player
end

#timeObject (readonly)

Returns the value of attribute time.



4
5
6
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 4

def time
  @time
end

Class Method Details

.attributesObject



14
15
16
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 14

def self.attributes
  @attributes ||= %i[time player_section heal_time]
end

.regexObject



6
7
8
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 6

def self.regex
  @regex ||= /#{regex_time} #{regex_player} triggered "first_heal_after_spawn" #{regex_heal_time}/.freeze
end

.regex_heal_timeObject



10
11
12
# File 'lib/tf2_line_parser/events/first_heal_after_spawn.rb', line 10

def self.regex_heal_time
  @regex_heal_time ||= '\(time "(?\'heal_time\'[0-9.]+)"\)'
end