Class: Australium::PlayerEnterGame

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

Constant Summary collapse

LOG_REGEX =
/"(?<player>.+)" entered the game/

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) ⇒ PlayerEnterGame

Returns a new instance of PlayerEnterGame


10
11
12
13
14
# File 'lib/australium/events/player_enter_game.rb', line 10

def initialize(data)
  super(data)
  player[:connected?, timestamp] = true
  player[:in_game?, timestamp] = true
end

Instance Attribute Details

#playerPlayer

Returns the Australium::Player who entered the game. This event always takes place after a corresponding Australium::PlayerConnect event.

Returns:


10
11
12
13
14
# File 'lib/australium/events/player_enter_game.rb', line 10

def initialize(data)
  super(data)
  player[:connected?, timestamp] = true
  player[:in_game?, timestamp] = true
end