Class: Australium::PlayerEnterGame
- 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_REGEX
Instance Attribute Summary collapse
-
#player ⇒ Player
The Player who entered the game.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data) ⇒ PlayerEnterGame
constructor
A new instance of PlayerEnterGame.
Methods inherited from Event
Constructor Details
#initialize(data) ⇒ PlayerEnterGame
Returns a new instance of PlayerEnterGame.
10 11 12 13 |
# File 'lib/australium/events/player_enter_game.rb', line 10 def initialize(data) super(data) state.players.find { |p| p == player }[:in_game?] = true end |
Instance Attribute Details
#player ⇒ Player
Returns the Australium::Player who entered the game. This event always takes place after a corresponding Australium::PlayerConnect event.
10 11 12 13 |
# File 'lib/australium/events/player_enter_game.rb', line 10 def initialize(data) super(data) state.players.find { |p| p == player }[:in_game?] = true end |