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); }
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); }
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); }
private static BingoState UpdateCalledNumbers(BingoState state, CalledNumbersUpdateAction action) { state.CalledNumbers = action.CalledNumbers; return(state); }
private static BingoState CardBingo(BingoState state, CardBingoAction action) { throw new System.NotImplementedException(); }