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); } }
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}!"); } }
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}!"); }