public addLobbyPlayer ( |
||
$user | The user to add to the lobby. | |
return | boolean | If successful, returns TRUE, otherwise, FALSE. |
public function addLobbyPlayer(User $user)
{
if ($this->state == GameState::LOBBY) {
$player_id = $user->getId();
if (!isset($this->lobbyPlayers[$player_id])) {
$this->lobbyPlayers[$player_id] = $user;
return TRUE;
}
}
}