Exemplo n.º 1
0
        private void SetGameState(SixNimmtInputState newInputState)
        {
            switch (newInputState)
            {
            case SixNimmtInputState.SelectCard:
                Debug.Assert(_currentRoundCards.Count == 0);
                break;

            case SixNimmtInputState.TakeRow:
            case SixNimmtInputState.PlaceCards:
                Debug.Assert(_currentRoundCards.Count == PlayerCount);
                break;

            default:
                throw new NotImplementedException("Best that we handle all states there.");
            }

            PlayInputState = newInputState;
        }
Exemplo n.º 2
0
 private SixNimmtGameState(SharedState sharedState, SixNimmtDeck deck)
 {
     PlayInputState = SixNimmtInputState.SelectCard;
     _sharedState   = sharedState;
     _board         = new int[BoardRowCount][];
     for (int row = 0; row < BoardRowCount; row++)
     {
         _board[row] = new int[MaxCardsPerRow];
     }
     _scores = new int[PlayerCount];
     for (int i = 0; i < _scores.Length; i++)
     {
         _scores[i] = StartingScore;
     }
     _boardRowCounts = new int[BoardRowCount];
     PlayerCards     = new List <int> [PlayerCount];
     for (int i = 0; i < PlayerCards.Length; i++)
     {
         PlayerCards[i] = new List <int>();
     }
     _remainingCards = new HashSet <int>(deck.Cards);
 }