示例#1
0
        public virtual GameRound StartRound()
        {
            var rnd = MakeRound(null);

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