コード例 #1
0
        private void TellCardProperty(TellCardPropertyAction action)
        {
            var propertyName  = action.PropertyName;
            var propertyValue = action.Value;
            var cards         = action.Cards;

            for (var cardNumber = 0; cardNumber < CardsCount; cardNumber++)
            {
                var queryContainsCurrentCard = cards.Contains(cardNumber);
                NextPlayer[cardNumber]
                .CheckPropertyValue(propertyName, propertyValue, queryContainsCurrentCard);
            }
        }
コード例 #2
0
        private void TellCardProperty(TellCardPropertyAction action)
        {
            var propertyName  = action.PropertyName;
            var propertyValue = action.Value;
            var cards         = action.Cards;

            foreach (var card in cards)
            {
                NextPlayer[card].CheckProperty(propertyValue);
            }

            if (NextPlayer.Count(card => card.GetProperty(propertyName).Equals(propertyValue)) != cards.Count)
            {
                throw new GameOverException($"Lie! Not full info about {propertyName}!");
            }
        }
コード例 #3
0
        private void TellCardProperty(TellCardPropertyAction action)
        {
            var propertyName  = action.PropertyName;
            var propertyValue = action.Value;
            var cards         = action.Cards;

            for (var cardNumber = 0; cardNumber < 5; cardNumber++)
            {
                NextPlayer[cardNumber].CheckProperty(propertyName, propertyValue, cards.Contains(cardNumber));
            }

//            foreach (var card in cards)
//                NextPlayer[card].CheckProperty(propertyName, propertyValue, true);
//
//            if (NextPlayer.Count(card => card.GetProperty(propertyName).Equals(propertyValue)) != cards.Count)
//                throw new GameOverException($"Lie! Not full info about {propertyName}!");
        }