public GameState(IEnumerable <Deck> decks, bool isAwaitingSubGameWinner) { var deckCopies = decks.Select(DeckHelper.GetDeckCopy).ToList(); Decks = deckCopies; IsAwaitingSubGameWinner = isAwaitingSubGameWinner; StateString = $"{IsAwaitingSubGameWinner}->{string.Join(";", Decks.Select(deck => deck.ToString()))}"; StateStringHashCode = StateString.GetHashCode(); }
public GameState(IList <Deck> decks, bool isAwaitingSubgameWinner) { var deckCopies = new List <Deck>(); foreach (var deck in decks) { var deckCopy = DeckHelper.GetDeckCopy(deck); deckCopies.Add(deckCopy); } Decks = deckCopies; IsAwaitingSubgameWinner = isAwaitingSubgameWinner; StateString = $"{IsAwaitingSubgameWinner}->{string.Join(";", Decks.Select(deck => deck.ToString()))}"; StateStringHashCode = StateString.GetHashCode(); }