Example #1
0
        public void CommitPlay(CardPlayer actor)
        {
            gameBoard.NotifyCommitPlacements();
            actor.FillHand();
            actor.NotifyEndTurn();

            if (RemainingCards <= 0)
            {
                EndGame();
            }
            else
            {
                NextGameTurn(actor);
            }
        }
Example #2
0
        CardPlayer GetNextPlayer(CardPlayer actor)
        {
            int i = 0;

            for ( ; i < players.Count; ++i)
            {
                if (players[i] == actor)
                {
                    break;
                }
            }

            if (i == players.Count)
            {
                return(null);
            }

            return(players[(i + 1) % players.Count]);
        }
Example #3
0
        public void AddPlayer(CardPlayer player)
        {
            if (players.Contains(player) == true)
            {
                return;
            }

            if (player == null)
            {
                return;
            }

            //don't add players during a game
            if (nextCard > 0)
            {
                return;
            }

            players.Add(player);
            player.NotifyEndTurn();
        }
Example #4
0
        void NextGameTurn(CardPlayer actor)
        {
            CardPlayer next = GetNextPlayer(actor);

            next.NotifyStartTurn();
        }
Example #5
0
 public void NotifyPlayerQuit(CardPlayer actor)
 {
 }
Example #6
0
 public void CancelPlay(CardPlayer actor)
 {
     gameBoard.NotifyCancelPlacements();
 }