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); }
// Move calendar up 1 week public void EndPhase() { switch (currentPhase) { case PlayPhase.WEEKDAY: bool gotoSaturday = CalendarController.instance.GotoSaturday(); if (gotoSaturday) { currentPhase = PlayPhase.SATURDAY; } break; case PlayPhase.SATURDAY: HandController.instance.DiscardHand(); CalendarController.instance.GotoSunday(); currentPhase = PlayPhase.SUNDAY; break; case PlayPhase.SUNDAY: CalendarController.instance.GotoWeekday(); DrawHand(); currentPhase = PlayPhase.WEEKDAY; break; } }
public void StartGame() { currentPhase = PlayPhase.WEEKDAY; PlayerStatsController.instance.InitStats(); DeckController.instance.InitDeck(); DrawHand(); }
public void nextPhase() { if (PlayPhase.nextPhase().Equals(PlayPhase.NewTurn)) { if (playerEnum.MoveNext()) { currentPlayer = playerEnum.Current as PlayerControl; deactivatePlayers(currentPlayer); currentPhase = PlayPhase.getCurrentPhase(); } else { playerEnum.Reset(); playerEnum.MoveNext(); currentPlayer = playerEnum.Current as PlayerControl; deactivatePlayers(currentPlayer); currentPhase = PlayPhase.getCurrentPhase(); } } else { currentPhase = PlayPhase.getCurrentPhase(); } }
internal void EnterPhase(PlayPhase phase) { this.gameLog.EndPhase(this); this.playPhase = phase; this.gameLog.BeginPhase(this); }
public void GotoPhase(PlayPhase phase) { currentPhase = phase; }