Class: Australium::PlayerKill

Inherits:
Event show all
Defined in:
lib/australium/events/player_kill.rb

Constant Summary collapse

LOG_REGEX =
/"(?<attacker>.+)" killed "(?<victim>.+)" with "(?<weapon>[^"]+)"/

Constants inherited from Event

Event::PROPERTY_REGEX, Event::TIMESTAMP_FORMAT, Event::TIMESTAMP_REGEX

Instance Attribute Summary collapse

Attributes inherited from Event

#raw

Instance Method Summary collapse

Methods inherited from Event

inherited, #to_s

Methods inherited from OpenStruct

#initialize_clone

Constructor Details

#initialize(data) ⇒ PlayerKill


13
14
15
16
17
18
19
# File 'lib/australium/events/player_kill.rb', line 13

def initialize(data)
  super(data)
  [attacker, victim].each do |player|
    player[:connected?, timestamp] = true
    player[:in_game?, timestamp] = true
  end
end

Instance Attribute Details

#attackerPlayer


13
14
15
16
17
18
19
# File 'lib/australium/events/player_kill.rb', line 13

def initialize(data)
  super(data)
  [attacker, victim].each do |player|
    player[:connected?, timestamp] = true
    player[:in_game?, timestamp] = true
  end
end

#victimPlayer


13
14
15
16
17
18
19
# File 'lib/australium/events/player_kill.rb', line 13

def initialize(data)
  super(data)
  [attacker, victim].each do |player|
    player[:connected?, timestamp] = true
    player[:in_game?, timestamp] = true
  end
end

#weaponString


13
14
15
16
17
18
19
# File 'lib/australium/events/player_kill.rb', line 13

def initialize(data)
  super(data)
  [attacker, victim].each do |player|
    player[:connected?, timestamp] = true
    player[:in_game?, timestamp] = true
  end
end