예제 #1
0
        private void UnoCheck(Player p, Game g)
        {
            if (p.Hand.Uno)
            {
                var unoCaller = _io.UnoMessage();
                switch (unoCaller)
                {
                case GameIO.UnoCaller.SELF:
                    _io.UnoNoPenalty();
                    break;

                case GameIO.UnoCaller.OTHER_PLAYER:
                    _io.UnoPenaltyForSelf();
                    p.Hand.AddCards(g.DrawCardsFromDeck(2));
                    break;

                case GameIO.UnoCaller.OTHER_PLAYER_INCORRECT:
                    var incorrectPlayer = _io.UnoPenaltyForOther(g.Players);
                    incorrectPlayer.Hand.AddCards(g.DrawCardsFromDeck(2));
                    break;

                case GameIO.UnoCaller.NOBODY:
                    _io.UnoNoPenalty();
                    break;
                }
            }
        }