protected override async Task ComputerTurnAsync() { await Task.Delay(10); var tempList = PlayerList.Where(items => items.PlayerCategory == EnumPlayerCategory.Computer).ToCustomBasicList(); foreach (var thisPlayer in tempList) { BingoItem ThisBingo = thisPlayer.BingoList.FirstOrDefault(Items => Items.WhatValue == CurrentInfo !.WhatValue); if (ThisBingo != null) { ThisBingo.DidGet = true; if (thisPlayer.BingoList.HasBingo == true) { if (BasicData !.MultiPlayer == true) { await Network !.SendAllAsync("bingo", thisPlayer.Id); } await GameOverAsync(thisPlayer.Id); break; } } } if (BasicData !.MultiPlayer == true) { await Network !.SendAllAsync("callnextnumber"); } await CallNextNumberAsync(); }
public override async Task SetUpGameAsync(bool isBeginning) { LoadControls(); if (FinishUpAsync == null) { throw new BasicBlankException("The loader never set the finish up code. Rethink"); } CustomBasicList <int> CardList = _rs !.GenerateRandomList(75); SaveRoot !.CallList.Clear(); SaveRoot.BingoBoard.ClearBoard(_model); //i think. CardList.ForEach(x => { CurrentInfo = new BingoItem(); CurrentInfo.WhatValue = x; CurrentInfo.Vector = new Vector(0, MatchNumber(x)); CurrentInfo.Letter = WhatLetter(CurrentInfo.Vector.Column); SaveRoot.CallList.Add(SaveRoot.CallList.Count + 1, CurrentInfo); }); CreateBingoCards(); await FinishUpAsync(isBeginning); await CallNextNumberAsync(); //maybe i can have here this time. }