protected override async Task ComputerTurnAsync() { if (Test !.NoAnimations == false) { await Delay !.DelaySeconds(.75); } if (SaveRoot !.WhatStatus == EnumStatusList.NormalPlay) { var moveList = SingleInfo !.MainHandList.Where(Items => IsValidMove(Items.Deck)).Select(Items => Items.Deck).ToCustomBasicList(); var otherList = SingleInfo.TempHand !.ValidCardList; otherList.KeepConditionalItems(Items => IsValidMove(Items.Deck)); var finList = otherList.Select(Items => Items.Deck).ToCustomBasicList(); moveList.AddRange(finList); if (moveList.Count == 0) { throw new BasicBlankException("There must be at least one move for the computer"); } await PlayCardAsync(moveList.GetRandomItem()); return; } if (SaveRoot.WhatStatus == EnumStatusList.WaitForOtherPlayers) { int id = PlayerList.Where(items => items.PlayerCategory == EnumPlayerCategory.Computer).Single().Id; _model !.BidAmount = _model.Bid1 !.NumberToChoose(); await _bidProcesses.ProcessBidAmountAsync(id); return; } if (SaveRoot.WhatStatus == EnumStatusList.ChooseTrump) { SaveRoot.TrumpSuit = _model !.Suit1 !.ItemToChoose(); await _trumpProcesses.TrumpChosenAsync(); return; } int ask1 = _gameContainer.Random.GetRandomNumber(2); if (ask1 == 1) { await _choiceProcesses.ChooseToPlayAsync(); } else { await _choiceProcesses.ChooseToPassAsync(); } }
public async Task BidAsync() { if (_gameContainer.BasicData !.MultiPlayer == true) { await _gameContainer.Network !.SendAllAsync("bid", _model.BidAmount); } int id = _gameContainer !.PlayerList !.Where(items => items.PlayerCategory == EnumPlayerCategory.Self).Single().Id; await _processes.ProcessBidAmountAsync(id); }