private async Task ContinueMailProcessesAsync(MailCard currentMail) { _model.MailPile.AddCard(currentMail); _gameContainer.SaveRoot !.CurrentMail = currentMail; _gameContainer.SaveRoot.GameStatus = EnumStatus.ViewMail; decimal pays; switch (currentMail.MailType) { case EnumMailType.MadMoney: _gameContainer.SaveRoot.Instructions = $"Please choose the player to collect {currentMail.AmountReceived.ToCurrency(0)} from"; _gameContainer.SaveRoot.GameStatus = EnumStatus.ChoosePlayer; break; case EnumMailType.Charity: pays = Math.Abs(currentMail.AmountReceived); _gameContainer.SaveRoot.Instructions = $"{currentMail.Description} for charity. {vb.vbCrLf} Please pay {pays.ToCurrency(0)}"; if (_gameContainer.Test !.NoAnimations == false) { await _gameContainer.Delay !.DelaySeconds(2); } _gameContainer.ProcessExpense(_gameBoard, pays); if (_gameContainer.Test.NoAnimations == false) { await _gameContainer.Delay !.DelaySeconds(1); } _gameContainer.SaveRoot.OutCards.Add(currentMail); break; case EnumMailType.MoveAhead: _gameContainer.SaveRoot.GameStatus = EnumStatus.DealOrBuy; break; case EnumMailType.MonsterCharge: pays = Math.Abs(currentMail.AmountReceived); _gameContainer.SaveRoot.Instructions = $"You received a monster charge of {pays.ToCurrency(0)} {vb.vbCrLf}Pay at the end of the month."; await MailBillsAsync(currentMail); break; case EnumMailType.Bill: pays = Math.Abs(currentMail.AmountReceived); _gameContainer.SaveRoot.Instructions = $"You received a bill in the amount of {pays.ToCurrency(0)}{ vb.vbCrLf}Pay at the end of the month."; await MailBillsAsync(currentMail); break; case EnumMailType.PayNeighbor: pays = Math.Abs(currentMail.AmountReceived); _gameContainer.SaveRoot.Instructions = $"Please choose the player to pay {pays.ToCurrency(0)} to"; _gameContainer.SaveRoot.GameStatus = EnumStatus.ChoosePlayer; break; default: break; } await _gameContainer.ContinueTurnAsync !.Invoke(); }
public CardInformation GetCard(int deck) { CardInformation output; if (deck <= 24) { output = new DealCard(); output.Populate(deck); return(output); } output = new MailCard(); output.Populate(deck); return(output); }
void IMailProcesses.SetUpMail() { CustomBasicList <int> list = _gameContainer.Random !.GenerateRandomList(47 + 24, 47, 25); if (list.Count != 47) { throw new BasicBlankException($"Must have 47 mail cards, not {list.Count} cards"); } _gameContainer.SaveRoot !.MailListLeft.Clear(); list.ForEach(index => { MailCard thisCard = (MailCard)_gameContainer.GetCard(index); _gameContainer.SaveRoot.MailListLeft.Add(thisCard); }); }
public static string PlayerChosen(PaydayGameContainer mainGame, PaydayVMData model) { if (model.PopUpList !.Count() == 1) { return(model.PopUpList.GetText(1)); //i think. } CustomBasicList <PaydayPlayerItem> tempList = GetPossiblePlayerList(mainGame, model); MailCard thisMail = model.MailPile.GetCardInfo(); return(thisMail.MailType switch { EnumMailType.MadMoney => tempList.OrderByDescending(Items => Items.NetIncome()).Take(1).Single().NickName, EnumMailType.PayNeighbor => tempList.OrderBy(Items => Items.NetIncome()).Take(1).Single().NickName, _ => throw new BasicBlankException($"Must be madmoney or payneighbor, not {thisMail.CardCategory.ToString()}"), });
private async Task MailBillsAsync(MailCard card) { _gameContainer.SaveRoot.GameStatus = EnumStatus.ViewMail; if (_gameContainer.Test !.NoAnimations == false) { await _gameContainer.Delay !.DelaySeconds(1); } //_model!.MailPile!.Visible = false; _gameContainer.SaveRoot !.CurrentMail = new MailCard(); _gameContainer.SingleInfo !.Hand.Add(card); PopulateMails(); _gameContainer.SaveRoot.GameStatus = EnumStatus.EndingTurn; if (_gameContainer.Test !.NoAnimations == false) { await _gameContainer.Delay !.DelaySeconds(2); } }
async Task IChoosePlayerProcesses.ProcessChosenPlayerAsync() { await _gameContainer.StartProcessPopUpAsync(_model); _gameContainer.SaveRoot.OutCards.Add(_gameContainer.SaveRoot.CurrentMail !); var thisPlayer = PlayerChosen(); _gameContainer.SaveRoot.CurrentMail = new MailCard(); MailCard thisMail = _model.MailPile.GetCardInfo(); if (thisMail.MailType == EnumMailType.MadMoney) { _gameContainer.SingleInfo !.MoneyHas += Math.Abs(thisMail.AmountReceived); thisPlayer.ReduceFromPlayer(Math.Abs(thisMail.AmountReceived)); } else { _gameContainer.SingleInfo !.ReduceFromPlayer(Math.Abs(thisMail.AmountReceived)); thisPlayer.MoneyHas += Math.Abs(thisMail.AmountReceived); } _gameContainer.SaveRoot.GameStatus = EnumStatus.EndingTurn; await _gameContainer.ContinueTurnAsync !.Invoke(); }