Beispiel #1
0
        internal PlayerState(IPlayerAction actions, int playerIndex, IGameLog gameLog, Random random, CardGameSubset gameSubset)
        {
            this.gameLog = gameLog;
            this.actions = new PlayerActionWithSelf(actions, this);
            this.playPhase = PlayPhase.NotMyTurn;
            this.random = random;
            this.playerIndex = playerIndex;

            // duplicates
            this.allOwnedCards = new BagOfCards(gameSubset);
            this.cardsInPlay = new BagOfCards(gameSubset, this.allOwnedCards);
            this.cardsInPlayAtBeginningOfCleanupPhase = new BagOfCards(gameSubset);

            // partition
            this.islandMat = new BagOfCards(gameSubset, this.allOwnedCards);
            this.nativeVillageMat = new BagOfCards(gameSubset, this.allOwnedCards);
            this.deck = new ListOfCards(gameSubset, this.allOwnedCards);
            this.discard = new BagOfCards(gameSubset, this.allOwnedCards);
            this.cardsBeingPlayed = new ListOfCards(gameSubset, this.allOwnedCards);  // a stack for recursion
            this.cardsBeingRevealed = new BagOfCards(gameSubset, this.allOwnedCards);
            this.hand = new BagOfCards(gameSubset, this.allOwnedCards);
            this.cardsPlayed = new BagOfCards(gameSubset, this.cardsInPlay);
            this.durationCards = new BagOfCards(gameSubset, this.cardsInPlay);
            this.cardsToReturnToHandAtStartOfTurn = new BagOfCards(gameSubset, this.allOwnedCards);
            this.cardToPass = new SingletonCardHolder(this.allOwnedCards);
            this.cardBeingDiscarded = new ListOfCards(gameSubset, this.allOwnedCards);

            this.turnCounters = new PlayerTurnCounters(gameSubset);
        }