public virtual GameRound StartRound() { var rnd = MakeRound(null); GameMessages.Emit(GameMessages.Kind.RoundBegin, rnd); return(rnd); }
public virtual GameTurn FinishGameTurn(GameTurn lastTurn) { if (IsRoundComplete) { return(null); } GameMessages.Emit(GameMessages.Kind.TurnEnd, lastTurn); return(BeginGameTurn(NextPlayer(lastTurn.ActivePlayer))); }
public bool LogoutPlayer(Player player) { if (m_playerList.Remove(player)) { GameMessages.Emit(GameMessages.Kind.PlayerLogout, player); return(true); } return(false); }
public virtual GameRound FinishRound(GameRound lastRound) { if (AreObjectivesComplete()) { GameMessages.Emit(GameMessages.Kind.GameObjectivesComplete, this); return(null); } GameMessages.Emit(GameMessages.Kind.RoundEnd, lastRound); return(MakeRound(lastRound)); }
protected GameTurn MakeTurn(Player player, GameTurn lastTurn) { var p = (player != null) ? player: FirstPlayer.Invoke(); var turn = m_gameTurnFactory.Invoke(p, this, lastTurn); if (turn != null) { GameMessages.Emit(GameMessages.Kind.TurnBegin, turn); turn.DoTurnBegin(); m_turns.Add(turn); } return(turn); }
public bool LoginPlayer(Player player) { if (m_playerList.Contains(player) == false) { m_playerList.Add(player); GameMessages.Emit(GameMessages.Kind.PlayerLogin, player); if (m_playerList.Count == 1) { GameMessages.Emit(GameMessages.Kind.AssignHost, player); } return(true); } return(false); }
public virtual void DoTurnStep() { GameMessages.Emit <GameTurn>(GameMessages.Kind.TurnStep, this); }
public virtual void FinishGame() { GameMessages.Emit(GameMessages.Kind.GameEnd, this); }
public virtual void StartGame() { GameMessages.Emit(GameMessages.Kind.GameBegin, this); }