Class: TF2LineParser::Events::PlayerExtinguished
- Defined in:
- lib/tf2_line_parser/events/player_extinguished.rb
Instance Attribute Summary collapse
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#weapon ⇒ Object
readonly
Returns the value of attribute weapon.
Attributes inherited from Event
#airshot, #cap_name, #cap_number, #customkill, #healing, #item, #length, #message, #method, #role, #score, #team, #type, #ubercharge, #unknown, #value
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(time, player_name, player_uid, player_steam_id, player_team, target_name, target_uid, target_steam_id, target_team, weapon) ⇒ PlayerExtinguished
constructor
A new instance of PlayerExtinguished.
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, player_name, player_uid, player_steam_id, player_team, target_name, target_uid, target_steam_id, target_team, weapon) ⇒ PlayerExtinguished
Returns a new instance of PlayerExtinguished.
22 23 24 25 26 27 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 22 def initialize(time, player_name, player_uid, player_steam_id, player_team, target_name, target_uid, target_steam_id, target_team, weapon) @time = parse_time(time) @player = Player.new(player_name, player_uid, player_steam_id, player_team) @target = Player.new(target_name, target_uid, target_steam_id, target_team) @weapon = weapon end |
Instance Attribute Details
#player ⇒ Object (readonly)
Returns the value of attribute player.
4 5 6 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 4 def player @player end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
4 5 6 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 4 def target @target end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 4 def time @time end |
#weapon ⇒ Object (readonly)
Returns the value of attribute weapon.
4 5 6 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 4 def weapon @weapon end |
Class Method Details
.attributes ⇒ Object
18 19 20 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 18 def self.attributes @attributes ||= %i[time player_section target_section weapon] end |
.regex ⇒ Object
6 7 8 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 6 def self.regex @regex ||= /#{regex_time} #{regex_player} triggered "player_extinguished" against #{regex_target} with #{regex_weapon}#{regex_positions}?/.freeze end |
.regex_positions ⇒ Object
14 15 16 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 14 def self.regex_positions @regex_positions ||= / \(attacker_position "[^"]+"\) \(victim_position "[^"]+"\)/ end |
.regex_weapon ⇒ Object
10 11 12 |
# File 'lib/tf2_line_parser/events/player_extinguished.rb', line 10 def self.regex_weapon @regex_weapon ||= '"(?\'weapon\'[^"]+)"' end |