예제 #1
0
        // returns the cards for the given player
        public Card[] getPlayerHand(string playerName)
        {
            RealPlayer player = rotationOrders.Find(x => x.name.Equals(playerName));

            if (player != null)
            {
                return(player.cards);
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        // add a player to the game, the game has not started when
        // this function is called.
        public bool addPlayer(string playerName)
        {
            Player player = new RealPlayer(playerName);

            if (players.Count == 6)
            {
                return(false);
            }
            else if (!players.Contains(player))
            {
                if (player is RealPlayer)
                {
                    rotationOrders.Add((RealPlayer)player);
                }
                players.Add(player);
                return(true);
            }

            return(false);
        }