Ejemplo n.º 1
0
        public virtual GameRound StartRound()
        {
            var rnd = MakeRound(null);

            GameMessages.Emit(GameMessages.Kind.RoundBegin, rnd);
            return(rnd);
        }
Ejemplo n.º 2
0
 public virtual GameTurn FinishGameTurn(GameTurn lastTurn)
 {
     if (IsRoundComplete)
     {
         return(null);
     }
     GameMessages.Emit(GameMessages.Kind.TurnEnd, lastTurn);
     return(BeginGameTurn(NextPlayer(lastTurn.ActivePlayer)));
 }
Ejemplo n.º 3
0
 public bool LogoutPlayer(Player player)
 {
     if (m_playerList.Remove(player))
     {
         GameMessages.Emit(GameMessages.Kind.PlayerLogout, player);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 public virtual void DoTurnStep()
 {
     GameMessages.Emit <GameTurn>(GameMessages.Kind.TurnStep, this);
 }
Ejemplo n.º 8
0
 public virtual void FinishGame()
 {
     GameMessages.Emit(GameMessages.Kind.GameEnd, this);
 }
Ejemplo n.º 9
0
 public virtual void StartGame()
 {
     GameMessages.Emit(GameMessages.Kind.GameBegin, this);
 }