Esempio n. 1
0
    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();
    }
Esempio n. 2
0
        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();
        }