Exemple #1
0
 private static BingoState StartCard(BingoState state, CardStartAction action)
 {
     state.Cards[action.CardIndex] = new BingoCard {
         Numbers = action.StartingNumbers
     };
     state.Cards[action.CardIndex].DaubedIndexes.Add(CARD_MIDDLE_INDEX);
     return(state);
 }
Exemple #2
0
        private static BingoState ResetGame(BingoState state, ResetGameAction action)
        {
            state.Cards[0] = new BingoCard();
            state.Cards[0].DaubedIndexes.Add(CARD_MIDDLE_INDEX);
            state.Cards[1] = new BingoCard();
            state.Cards[1].DaubedIndexes.Add(CARD_MIDDLE_INDEX);

            return(state);
        }
Exemple #3
0
        private static BingoState CardDaubNumber(BingoState state, CardDaubNumberAction action)
        {
            BingoCard card = state.Cards[action.CardIndex];

            int attemptedNumber = card.Numbers[action.NumberIndex];

            if (state.CalledNumbers.Contains(attemptedNumber))
            {
                card.DaubedIndexes.Add(action.NumberIndex);
            }

            return(state);
        }
Exemple #4
0
 private static BingoState UpdateCalledNumbers(BingoState state, CalledNumbersUpdateAction action)
 {
     state.CalledNumbers = action.CalledNumbers;
     return(state);
 }
Exemple #5
0
 private static BingoState CardBingo(BingoState state, CardBingoAction action)
 {
     throw new System.NotImplementedException();
 }