Class: Australium::PlayerSuicide

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

Constant Summary collapse

LOG_REGEX =
/"(?<player>.+)" committed suicide 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) ⇒ PlayerSuicide

Returns a new instance of PlayerSuicide


11
12
13
14
15
16
# File 'lib/australium/events/player_suicide.rb', line 11

def initialize(data)
  super(data)

  player[:connected?, timestamp] = true
  player[:in_game?, timestamp] = true
end

Instance Attribute Details

#playerPlayer

Returns the Australium::Player who committed suicide.

Returns:


11
12
13
14
15
16
# File 'lib/australium/events/player_suicide.rb', line 11

def initialize(data)
  super(data)

  player[:connected?, timestamp] = true
  player[:in_game?, timestamp] = true
end

#weaponString

Returns the name of the weapon the player committed suicide with (can be World).

Returns:

  • (String)

    the name of the weapon the player committed suicide with (can be World).


11
12
13
14
15
16
# File 'lib/australium/events/player_suicide.rb', line 11

def initialize(data)
  super(data)

  player[:connected?, timestamp] = true
  player[:in_game?, timestamp] = true
end