private static CustomBasicList <PaydayPlayerItem> GetPossiblePlayerList(PaydayGameContainer mainGame, PaydayVMData model) { CustomBasicList <PaydayPlayerItem> output = new CustomBasicList <PaydayPlayerItem>(); CustomBasicList <string> tempList = model.PopUpList !.TextList.Select(items => items.DisplayText).ToCustomBasicList(); tempList.ForEach(Name => { output.Add(mainGame.PlayerList.Single(Items => Items.NickName == Name)); }); return(output); }
public static async Task StartProcessPopUpAsync(this PaydayGameContainer gameContainer, PaydayVMData model) { if (gameContainer.SingleInfo !.CanSendMessage(gameContainer.BasicData)) { await gameContainer.Network !.SendAllAsync("popupchosen", model.PopUpChosen); } model.PopUpList.ShowOnlyOneSelectedItem(model.PopUpChosen); if (gameContainer.Test.NoAnimations == false) { await gameContainer.Delay.DelaySeconds(1.5); } }
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()}"), });
public MoveProcesses( PaydayGameContainer gameContainer, PaydayVMData model, GameBoardProcesses gameBoard, ILotteryProcesses lotteryProcesses, IMailProcesses mailProcesses, IYardSaleProcesses yardSaleProcesses, IBuyProcesses buyProcesses, IDealProcesses dealProcesses ) { _gameContainer = gameContainer; _model = model; _gameBoard = gameBoard; _lotteryProcesses = lotteryProcesses; _mailProcesses = mailProcesses; _yardSaleProcesses = yardSaleProcesses; _buyProcesses = buyProcesses; _dealProcesses = dealProcesses; }
internal static bool ShouldReshuffle(this PaydayGameContainer gameContainer) { gameContainer.SingleInfo = gameContainer.PlayerList !.GetWhoPlayer(); if (gameContainer.BasicData !.MultiPlayer == false) { return(true); } if (gameContainer.SingleInfo.PlayerCategory == EnumPlayerCategory.Self) { return(true); } if (gameContainer.SingleInfo.PlayerCategory == EnumPlayerCategory.OtherHuman) { return(false); } if (gameContainer.BasicData.Client == false) { return(true); } return(false); }
private readonly GameBoardGraphicsCP _graphicsBoard; //hopefully this simple. public GameBoardProcesses(PaydayGameContainer gameContainer, GameBoardGraphicsCP boardGraphicsCP) { _gameContainer = gameContainer; _graphicsBoard = boardGraphicsCP; _dayList = new CustomBasicList <EnumDay> { EnumDay.Mail, EnumDay.SweepStakes, EnumDay.Mail, EnumDay.Deal, EnumDay.Mail, EnumDay.Lottery, EnumDay.SkiWeekEnd, EnumDay.RadioContest, EnumDay.Buyer, EnumDay.HappyBirthday, EnumDay.Mail, EnumDay.Deal, EnumDay.Lottery, EnumDay.CharityConcert, EnumDay.Deal, EnumDay.Mail, EnumDay.Buyer, EnumDay.Food, EnumDay.Mail, EnumDay.Lottery, EnumDay.YardSale, EnumDay.Mail, EnumDay.Buyer, EnumDay.Mail, EnumDay.Deal, EnumDay.Buyer, EnumDay.Lottery, EnumDay.ShoppingSpree, EnumDay.Buyer, EnumDay.WalkForCharity }; }
public PaydayMainGameClass(IGamePackageResolver resolver, IEventAggregator aggregator, BasicData basic, TestOptions test, PaydayVMData model, IMultiplayerSaveState state, IAsyncDelayer delay, CommandContainer command, PaydayGameContainer container, StandardRollProcesses <SimpleDice, PaydayPlayerItem> roller, GameBoardProcesses gameBoard, IMailProcesses mailProcesses, IDealProcesses dealProcesses, ILotteryProcesses lotteryProcesses, IYardSaleProcesses yardSaleProcesses, IBuyProcesses buyProcesses, IChoosePlayerProcesses playerProcesses, IDealBuyChoiceProcesses choiceProcesses, IMoveProcesses moveProcesses ) : base(resolver, aggregator, basic, test, model, state, delay, command, container, roller) { _model = model; _command = command; _gameBoard = gameBoard; _mailProcesses = mailProcesses; _dealProcesses = dealProcesses; _lotteryProcesses = lotteryProcesses; _yardSaleProcesses = yardSaleProcesses; _buyProcesses = buyProcesses; _playerProcesses = playerProcesses; _choiceProcesses = choiceProcesses; _gameContainer = container; _gameContainer.OtherTurnProgressAsync = OtherTurnProgressAsync; _gameContainer.SpaceClickedAsync = _gameBoard.AnimateMoveAsync; _gameContainer.ResultsOfMoveAsync = moveProcesses.ResultsOfMoveAsync; }
public PaydayMainView(IEventAggregator aggregator, TestOptions test, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register, PaydayGameContainer gameContainer, PaydayVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(PaydayMainViewModel.RestoreScreen)); } _aggregator = aggregator; _gameContainer = gameContainer; _model = model; _aggregator.Subscribe(this); _board = new GameBoardXF(); register.RegisterControl(_board.Element, "main"); graphicsCP.LinkBoard(); _score = new ScoreBoardXF(); _score.AddColumn("Money", true, nameof(PaydayPlayerItem.MoneyHas), useCurrency: true, rightMargin: 10); _score.AddColumn("Loans", true, nameof(PaydayPlayerItem.Loans), useCurrency: true, rightMargin: 10); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Main Turn", nameof(PaydayMainViewModel.NormalTurn)); firstInfo.AddRow("Other Turn", nameof(PaydayMainViewModel.OtherLabel)); firstInfo.AddRow("Progress", nameof(PaydayMainViewModel.MonthLabel)); firstInfo.AddRow("Status", nameof(PaydayMainViewModel.Status)); var firstContent = firstInfo.GetContent; StackLayout tempStack = new StackLayout(); AddVerticalLabelGroup("Instructions", nameof(PaydayMainViewModel.Instructions), tempStack); ScrollView tempScroll = new ScrollView(); tempScroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Never; tempScroll.Content = tempStack; StackLayout firstStack = new StackLayout(); firstStack.Orientation = StackOrientation.Horizontal; firstStack.Children.Add(_board); mainStack.Children.Add(firstStack); firstStack.Margin = new Thickness(3, 3, 3, 0); Grid rightGrid = new Grid(); //this is very iffy. lots of adjustments may be needed. //it only works for large tablets now anyways. firstStack.Children.Add(rightGrid); AddPixelRow(rightGrid, 225); AddLeftOverRow(rightGrid, 1); AddAutoColumns(rightGrid, 1); Grid grid1 = new Grid(); AddControlToGrid(rightGrid, grid1, 0, 0); AddAutoRows(grid1, 1); AddPixelColumn(grid1, 200); AddPixelColumn(grid1, 130); AddPixelColumn(grid1, 250); //AddLeftOverColumn(grid1, 1); StackLayout stack1 = new StackLayout(); AddControlToGrid(grid1, stack1, 0, 0); ParentSingleUIContainer mailPile = new ParentSingleUIContainer(nameof(PaydayMainViewModel.MailPileScreen)); ParentSingleUIContainer dealPile = new ParentSingleUIContainer(nameof(PaydayMainViewModel.DealPileScreen)); stack1.Children.Add(mailPile); stack1.Children.Add(dealPile); ParentSingleUIContainer roller = new ParentSingleUIContainer(nameof(PaydayMainViewModel.RollerScreen)); stack1.Children.Add(roller); AddControlToGrid(grid1, tempScroll, 0, 1); // instructions on card //StackLayout endStack = new StackLayout(); //endStack.Children.Add(_score); //endStack.Children.Add(firstContent); AddControlToGrid(grid1, _score, 0, 2); //AddControlToGrid(grid1, firstContent, 0, 2); //AddControlToGrid(grid1, _score, 0, 3); Grid grid2 = new Grid(); AddControlToGrid(rightGrid, grid2, 1, 0); AddAutoRows(grid2, 1); AddAutoColumns(grid2, 1); AddLeftOverColumn(grid2, 1); StackLayout finalStack = new StackLayout(); _dealList = new BaseHandXF <DealCard, CardGraphicsCP, DealCardXF>(); _dealList.HeightRequest = 500; _dealList.HandType = HandObservable <DealCard> .EnumHandList.Vertical; _dealList.HorizontalOptions = LayoutOptions.Start; finalStack.Children.Add(_dealList); AddControlToGrid(grid2, finalStack, 0, 0); _currentPiece = new PawnPiecesXF <EnumColorChoice>(); _currentPiece.IsVisible = false; // until proven to need it _currentPiece.WidthRequest = 70; _currentPiece.HeightRequest = 70; _currentPiece.Margin = new Thickness(5, 5, 5, 5); _currentPiece.Init(); finalStack.Children.Add(_currentPiece); ParentSingleUIContainer mailList = new ParentSingleUIContainer(nameof(PaydayMainViewModel.MailListScreen)); AddControlToGrid(grid2, mailList, 0, 1); ParentSingleUIContainer extras = new ParentSingleUIContainer(nameof(PaydayMainViewModel.DealOrBuyScreen)); AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer(nameof(PaydayMainViewModel.BuyDealScreen)); AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer(nameof(PaydayMainViewModel.ChooseDealScreen)); AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer(nameof(PaydayMainViewModel.LotteryScreen)); AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer(nameof(PaydayMainViewModel.PlayerScreen)); AddControlToGrid(grid2, extras, 0, 1); //_score.Margin = new Thickness(0, -150, 0, 0); mainStack.Children.Add(firstContent); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public DealBuyChoiceProcesses(PaydayGameContainer gameContainer, PaydayVMData model, GameBoardProcesses gameBoard) { _gameContainer = gameContainer; _model = model; _gameBoard = gameBoard; }
internal static void ProcessExpense(this PaydayGameContainer gameContainer, GameBoardProcesses gameBoard, decimal amount) { gameBoard !.AddToJackPot(amount); gameContainer.SingleInfo !.ReduceFromPlayer(amount); }
internal static void MonthLabel(this PaydayGameContainer gameContainer, PaydayVMData model) { model !.MonthLabel = $"Payday, month {gameContainer.SingleInfo!.CurrentMonth} of {gameContainer.SaveRoot!.MaxMonths}"; }
public MailProcesses(PaydayGameContainer gameContainer, PaydayVMData model, GameBoardProcesses gameBoard) { _gameContainer = gameContainer; _model = model; _gameBoard = gameBoard; }
public PaydayMainView(IEventAggregator aggregator, TestOptions test, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register, PaydayGameContainer gameContainer, PaydayVMData model ) { StackPanel mainStack = new StackPanel(); _aggregator = aggregator; _gameContainer = gameContainer; _model = model; _aggregator.Subscribe(this); _board = new GameBoardWPF(); register.RegisterControl(_board.Element, "main"); graphicsCP.LinkBoard(); _score = new ScoreBoardWPF(); _score.AddColumn("Money", true, nameof(PaydayPlayerItem.MoneyHas), useCurrency: true, rightMargin: 10); _score.AddColumn("Loans", true, nameof(PaydayPlayerItem.Loans), useCurrency: true, rightMargin: 10); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Main Turn", nameof(PaydayMainViewModel.NormalTurn)); firstInfo.AddRow("Other Turn", nameof(PaydayMainViewModel.OtherLabel)); firstInfo.AddRow("Progress", nameof(PaydayMainViewModel.MonthLabel)); firstInfo.AddRow("Status", nameof(PaydayMainViewModel.Status)); //firstInfo.AddRow("Instructions", nameof(PaydayMainViewModel.Instructions)); var firstContent = firstInfo.GetContent; StackPanel tempStack = new StackPanel(); AddVerticalLabelGroup("Instructions", nameof(PaydayMainViewModel.Instructions), tempStack); ScrollViewer tempScroll = new ScrollViewer(); tempScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; tempScroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; tempScroll.Content = tempStack; ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.RestoreScreen) }; } StackPanel firstStack = new StackPanel(); firstStack.Orientation = Orientation.Horizontal; firstStack.Children.Add(_board); mainStack.Children.Add(firstStack); firstStack.Margin = new Thickness(3, 3, 3, 3); Grid rightGrid = new Grid(); firstStack.Children.Add(rightGrid); AddPixelRow(rightGrid, 225); AddLeftOverRow(rightGrid, 1); AddAutoColumns(rightGrid, 1); Grid grid1 = new Grid(); AddControlToGrid(rightGrid, grid1, 0, 0); AddAutoRows(grid1, 1); AddPixelColumn(grid1, 200); AddPixelColumn(grid1, 150); AddPixelColumn(grid1, 200); AddLeftOverColumn(grid1, 1); StackPanel stack1 = new StackPanel(); AddControlToGrid(grid1, stack1, 0, 0); ParentSingleUIContainer mailPile = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.MailPileScreen) }; ParentSingleUIContainer dealPile = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.DealPileScreen) }; stack1.Children.Add(mailPile); stack1.Children.Add(dealPile); ParentSingleUIContainer roller = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.RollerScreen) }; stack1.Children.Add(roller); AddControlToGrid(grid1, tempScroll, 0, 1); // instructions on card AddControlToGrid(grid1, firstContent, 0, 2); AddControlToGrid(grid1, _score, 0, 3); Grid grid2 = new Grid(); AddControlToGrid(rightGrid, grid2, 1, 0); AddAutoRows(grid2, 1); AddAutoColumns(grid2, 1); AddLeftOverColumn(grid2, 1); StackPanel finalStack = new StackPanel(); _dealList = new BaseHandWPF <DealCard, CardGraphicsCP, DealCardWPF>(); _dealList.Height = 500; _dealList.HandType = HandObservable <DealCard> .EnumHandList.Vertical; _dealList.HorizontalAlignment = HorizontalAlignment.Left; finalStack.Children.Add(_dealList); AddControlToGrid(grid2, finalStack, 0, 0); _currentPiece = new PawnPiecesWPF <EnumColorChoice>(); _currentPiece.Visibility = Visibility.Collapsed; // until proven to need it _currentPiece.Width = 80; _currentPiece.Height = 80; _currentPiece.Margin = new Thickness(5, 5, 5, 5); _currentPiece.Init(); finalStack.Children.Add(_currentPiece); ParentSingleUIContainer mailList = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.MailListScreen) }; AddControlToGrid(grid2, mailList, 0, 1); ParentSingleUIContainer extras = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.DealOrBuyScreen) }; AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.ChooseDealScreen) }; AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.LotteryScreen) }; AddControlToGrid(grid2, extras, 0, 1); extras = new ParentSingleUIContainer() { Name = nameof(PaydayMainViewModel.PlayerScreen) }; AddControlToGrid(grid2, extras, 0, 1); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public YardSaleProcesses(PaydayGameContainer gameContainer, IDealProcesses dealProcesses) { _gameContainer = gameContainer; _dealProcesses = dealProcesses; }
public BuyProcesses(PaydayGameContainer gameContainer, PaydayVMData model) { _gameContainer = gameContainer; _model = model; }
public ChoosePlayerProcesses(PaydayGameContainer gameContainer, PaydayVMData model) { _gameContainer = gameContainer; _model = model; }
internal static void PopulateDeals(this PaydayGameContainer gameContainer, PaydayVMData model) { var tempList = gameContainer.SingleInfo !.Hand.GetMailOrDealList <DealCard>(EnumCardCategory.Deal); model !.CurrentDealList !.HandList.ReplaceRange(tempList); }