public ActionDoAgainView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Card List";
            StackLayout stack = new StackLayout();

            SetUpMarginsOnParentControl(stack); //i think.
            ListChooserXF list = new ListChooserXF();

            list.LoadLists(actionContainer.CardList1 !); // i think
            ScrollView thisScroll = new ScrollView();

            thisScroll.Orientation   = ScrollOrientation.Vertical;
            thisScroll.Content       = list;
            thisScroll.HeightRequest = 500; // well see.
            stack.Orientation        = StackOrientation.Horizontal;
            stack.Children.Add(thisScroll);
            StackLayout finalStack = new StackLayout();

            stack.Children.Add(finalStack);
            var button = GetGamingButton("Select Card", nameof(ActionDoAgainViewModel.SelectCardAsync)); // i think

            finalStack.Children.Add(button);
            button = GetGamingButton("View Card", nameof(ActionDoAgainViewModel.ViewCard));
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
示例#2
0
 public FluxxMainViewModel(CommandContainer commandContainer,
                           FluxxMainGameClass mainGame,
                           FluxxVMData viewModel,
                           BasicData basicData,
                           TestOptions test,
                           IGamePackageResolver resolver,
                           FluxxGameContainer gameContainer,
                           IDiscardProcesses discardProcesses,
                           IAnalyzeProcesses analyzeQueProcesses,
                           KeeperContainer keeperContainer,
                           FluxxDelegates delegates
                           )
     : base(commandContainer, mainGame, viewModel, basicData, test, resolver)
 {
     _mainGame                              = mainGame;
     _model                                 = viewModel;
     _resolver                              = resolver;
     _gameContainer                         = gameContainer;
     _discardProcesses                      = discardProcesses;
     _analyzeQueProcesses                   = analyzeQueProcesses;
     _keeperContainer                       = keeperContainer;
     _delegates                             = delegates;
     _model.Deck1.NeverAutoDisable          = true;
     _gameContainer.LoadGiveAsync           = LoadGiveAsync;
     _gameContainer.LoadPlayAsync           = LoadPlayAsync;
     _model.Keeper1.ConsiderSelectOneAsync += OnConsiderSelectOneCardAsync;
     _model.Goal1.ConsiderSelectOneAsync   += OnConsiderSelectOneCardAsync;
 }
        public ActionDoAgainView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Card List";
            StackPanel stack    = new StackPanel();
            SKRect     thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(stack, thisRect); //i think.
            ListChooserWPF list = new ListChooserWPF();

            list.LoadLists(actionContainer.CardList1 !); // i think
            ScrollViewer thisScroll = new ScrollViewer();

            thisScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            thisScroll.Content = list;
            thisScroll.Height  = 500; // well see.
            stack.Orientation  = Orientation.Horizontal;
            stack.Children.Add(thisScroll);
            StackPanel finalStack = new StackPanel();

            stack.Children.Add(finalStack);
            var button = GetGamingButton("Select Card", nameof(ActionDoAgainViewModel.SelectCardAsync)); // i think

            finalStack.Children.Add(button);
            button = GetGamingButton("View Card", nameof(ActionDoAgainViewModel.ViewCard));
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
 public ActionFirstCardRandomViewModel(FluxxGameContainer gameContainer,
                                       ActionContainer actionContainer,
                                       KeeperContainer keeperContainer,
                                       FluxxDelegates delegates,
                                       IFluxxEvent fluxxEvent,
                                       BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
 }
示例#5
0
 public ActionEverybodyGetsOneViewModel(FluxxGameContainer gameContainer,
                                        ActionContainer actionContainer,
                                        KeeperContainer keeperContainer,
                                        FluxxDelegates delegates,
                                        IFluxxEvent fluxxEvent,
                                        BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
 }
示例#6
0
 public ActionDiscardRulesViewModel(FluxxGameContainer gameContainer,
                                    ActionContainer actionContainer,
                                    KeeperContainer keeperContainer,
                                    FluxxDelegates delegates,
                                    IFluxxEvent fluxxEvent,
                                    BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
     RulesToDiscard = actionContainer.RulesToDiscard;
 }
示例#7
0
        public ShowCardUI(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer, EnumShowCategory category)
        {
            DataContext = actionContainer;
            switch (category)
            {
            case EnumShowCategory.MainScreen:
                Text    = "Card Information";
                _detail = model.CardDetail;
                break;

            case EnumShowCategory.CurrentAction:
                Text = "Current Card Information";
                //var thisAction1 = (ActionViewModel)thisMod.Action1!;
                _detail = actionContainer.CurrentDetail;
                break;

            case EnumShowCategory.MainAction:
                SetBinding(TextProperty, new Binding(nameof(ActionContainer.ActionFrameText)));
                //var thisAction2 = (ActionViewModel)thisMod.Action1!;
                _detail = actionContainer.ActionDetail;
                break;

            case EnumShowCategory.KeeperScreen:
                Text = "Current Card Information";
                //var thisKeeper = (KeeperViewModel)thisMod.KeeperControl1!;
                _detail = keeperContainer.CardDetail;
                break;

            default:
                throw new BasicBlankException("Category Not Found");
            }
            _detail !.Card = this;
            Grid   tempGrid = new Grid();
            SKRect thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(tempGrid, thisRect); //i think.
            AddAutoColumns(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            _graphics           = new CardGraphicsWPF();
            _label              = GetDefaultLabel();
            _label.Text         = _detail.CurrentCard.Description;
            _label.TextWrapping = TextWrapping.Wrap;
            _graphics.SendSize("", _detail.CurrentCard);
            AddControlToGrid(tempGrid, _graphics, 0, 0);
            _label.Margin = new Thickness(10, 3, 5, 3);
            AddControlToGrid(tempGrid, _label, 0, 1);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(tempGrid);
            Content = grid;
        }
示例#8
0
 public FluxxMainGameClass(IGamePackageResolver mainContainer,
                           IEventAggregator aggregator,
                           BasicData basicData,
                           TestOptions test,
                           FluxxVMData currentMod,
                           IMultiplayerSaveState state,
                           IAsyncDelayer delay,
                           ICardInfo <FluxxCardInformation> cardInfo,
                           CommandContainer command,
                           FluxxGameContainer gameContainer,
                           IGiveTaxationProcesses giveTaxationProcesses,
                           IEmptyTrashProcesses emptyTrashProcesses,
                           IPlayProcesses playProcesses,
                           ActionContainer actionContainer,
                           KeeperContainer keeperContainer,
                           FluxxDelegates delegates,
                           IShowActionProcesses showActionProcesses,
                           IDiscardProcesses discardProcesses,
                           IRotateTradeHandProcesses rotateTradeHandProcesses,
                           IFinalKeeperProcesses finalKeeperProcesses,
                           IFinalRuleProcesses finalRuleProcesses,
                           IEverybodyOneProcesses everybodyOneProcesses,
                           IDrawUseProcesses drawUseProcesses,
                           IAnalyzeProcesses analyzeProcesses,
                           ILoadActionProcesses loadActionProcesses
                           )
     : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer)
 {
     _model                        = currentMod;
     _command                      = command;
     _gameContainer                = gameContainer;
     _giveTaxationProcesses        = giveTaxationProcesses;
     _emptyTrashProcesses          = emptyTrashProcesses;
     _playProcesses                = playProcesses;
     _actionContainer              = actionContainer;
     _keeperContainer              = keeperContainer;
     _delegates                    = delegates;
     _showActionProcesses          = showActionProcesses;
     _discardProcesses             = discardProcesses;
     _rotateTradeHandProcesses     = rotateTradeHandProcesses;
     _finalKeeperProcesses         = finalKeeperProcesses;
     _finalRuleProcesses           = finalRuleProcesses;
     _everybodyOneProcesses        = everybodyOneProcesses;
     _drawUseProcesses             = drawUseProcesses;
     _analyzeProcesses             = analyzeProcesses;
     _loadActionProcesses          = loadActionProcesses;
     _model.PlayerHand1.AutoSelect = HandObservable <FluxxCardInformation> .EnumAutoType.SelectAsMany;
 }
        public ActionDrawUseView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackLayout mainStack = new StackLayout();
            FluxxHandXF hand      = new FluxxHandXF();

            hand.LoadList(actionContainer !.TempHand !, "");                                          // i think this is the only difference for this one.
            mainStack.Children.Add(hand);
            var button = GetGamingButton("Choose Card", nameof(ActionDrawUseViewModel.DrawUseAsync)); //hopefully this simple (?)

            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
示例#10
0
 public BasicActionScreen(FluxxGameContainer gameContainer,
                          ActionContainer actionContainer,
                          KeeperContainer keeperContainer,
                          FluxxDelegates delegates,
                          IFluxxEvent fluxxEvent,
                          BasicActionLogic basicActionLogic
                          )
 {
     GameContainer    = gameContainer;
     ActionContainer  = actionContainer;
     _keeperContainer = keeperContainer;
     _delegates       = delegates;
     FluxxEvent       = fluxxEvent;
     BasicActionLogic = basicActionLogic;
     CommandContainer = gameContainer.Command;
     ActionContainer.PropertyChanged += ActionContainer_PropertyChanged;
     ButtonChooseCardVisible          = ActionContainer.ButtonChooseCardVisible;
 }
        private async Task LoadKeeperScreenAsync(KeeperContainer keeperContainer)
        {
            //this is easiest one.
            if (KeeperScreen != null)
            {
                return; //try to ignore because we already have the keeper screen (?)
            }
            await CloseActionScreenAsync();
            await CloseMainAsync();

            KeeperScreen = keeperContainer.Section switch
            {
                EnumKeeperSection.None => MainContainer.Resolve <KeeperShowViewModel>(),
                EnumKeeperSection.Trash => MainContainer.Resolve <KeeperTrashViewModel>(),
                EnumKeeperSection.Steal => MainContainer.Resolve <KeeperStealViewModel>(),
                EnumKeeperSection.Exchange => MainContainer.Resolve <KeeperExchangeViewModel>(),
                _ => throw new BasicBlankException("Not Supported"),
            };
            await LoadScreenAsync(KeeperScreen);
        }
        public ActionTakeUseView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            var mainStack = new StackLayout();
            var player    = new PlayerUI(actionContainer, true, 50, 800);

            //player.ItemHeight = 50;
            //player.ItemWidth = 1300;
            mainStack.Children.Add(player);
            var otherHand = new FluxxHandXF();

            otherHand.LoadList(actionContainer !.OtherHand !, "");
            otherHand.MinimumWidthRequest = 400;
            mainStack.Children.Add(otherHand);
            var button   = GetGamingButton("Choose Card", nameof(ActionTakeUseViewModel.ChooseCardAsync));
            var thisBind = new Binding(nameof(ActionTakeUseViewModel.ButtonChooseCardVisible));

            button.SetBinding(Button.IsVisibleProperty, thisBind);
            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
示例#13
0
        public ActionTakeUseView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            var mainStack = new StackPanel();
            var player    = new PlayerUI(actionContainer, true, 50, 800);

            //player.ItemHeight = 50;
            //player.ItemWidth = 1300;
            mainStack.Children.Add(player);
            var otherHand = new FluxxHandWPF();

            otherHand.LoadList(actionContainer !.OtherHand !, "");
            otherHand.MinWidth = 400;
            mainStack.Children.Add(otherHand);
            var button   = GetGamingButton("Choose Card", nameof(ActionTakeUseViewModel.ChooseCardAsync));
            var thisBind = GetVisibleBinding(nameof(ActionTakeUseViewModel.ButtonChooseCardVisible));

            button.SetBinding(Button.VisibilityProperty, thisBind);
            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
示例#14
0
 public KeeperActionViewModel(FluxxGameContainer gameContainer, KeeperContainer keeperContainer, IFluxxEvent fluxxEvent) : base(gameContainer, keeperContainer)
 {
     _fluxxEvent = fluxxEvent;
     keeperContainer.ButtonText = ButtonText;
 }
 public KeeperTrashViewModel(FluxxGameContainer gameContainer, KeeperContainer keeperContainer, IFluxxEvent fluxxEvent) : base(gameContainer, keeperContainer, fluxxEvent)
 {
 }
        public ActionEverybodyGetsOneView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            var mainStack = new StackLayout();

            mainStack.Orientation = StackOrientation.Horizontal;
            var player = new PlayerUI(actionContainer, false, 50, 800);

            mainStack.Children.Add(player);
            StackLayout finalStack = new StackLayout();

            mainStack.Children.Add(finalStack);
            FluxxHandXF otherHand = new FluxxHandXF();

            otherHand.LoadList(actionContainer.TempHand !, "");
            otherHand.Margin = new Thickness(3, 15, 0, 0);
            finalStack.Children.Add(otherHand);
            var button = GetGamingButton("Give Cards To Selected Player", nameof(ActionEverybodyGetsOneViewModel.GiveCardsAsync)); // i think

            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
 public KeeperShowViewModel(FluxxGameContainer gameContainer, KeeperContainer keeperContainer, IFluxxEvent fluxxEvent) : base(gameContainer, keeperContainer)
 {
     _fluxxEvent = fluxxEvent;
 }
示例#18
0
        public ActionDiscardRulesView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackLayout mainStack = new StackLayout();

            var firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Rules To Discard", nameof(ActionDiscardRulesViewModel.RulesToDiscard)); // i think
            mainStack.Children.Add(firstInfo.GetContent);
            var nextLabel = GetDefaultLabel();

            nextLabel.Margin = new Thickness(3, 15, 0, 2);
            nextLabel.Text   = "Choose Rules To Discard";
            ScrollView scroll = new ScrollView(); // could have to scroll

            scroll.Orientation   = ScrollOrientation.Vertical;
            scroll.HeightRequest = 400;
            ListChooserXF rule1 = new ListChooserXF();

            rule1.LoadLists(actionContainer !.Rule1 !);
            rule1.ItemHeight = 40;
            rule1.ItemWidth  = 600;
            scroll.Content   = rule1;
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            otherStack.Children.Add(scroll);
            var         button     = GetGamingButton("View Card", nameof(ActionDiscardRulesViewModel.ViewRuleCard));
            StackLayout finalStack = new StackLayout();

            finalStack.Children.Add(button);
            button = GetGamingButton("Discard Selected Rule(s)", nameof(ActionDiscardRulesViewModel.DiscardRulesAsync));
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            otherStack.Children.Add(finalStack);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
        public KeeperBaseView(FluxxGameContainer gameContainer,
                              KeeperContainer keeperContainer,
                              ActionContainer actionContainer,
                              FluxxVMData model
                              )
        {
            _grid           = new Grid();
            GameContainer   = gameContainer;
            KeeperContainer = keeperContainer;
            ActionContainer = actionContainer;
            _model          = model;
            if (gameContainer.PlayerList.Count() <= 3)
            {
                AddAutoRows(_grid, 3);
            }
            else
            {
                AddAutoRows(_grid, 4);
            }

            if (gameContainer.PlayerList.Count() == 2 || gameContainer.PlayerList.Count() == 4)
            {
                AddLeftOverColumn(_grid, 50);
                AddLeftOverColumn(_grid, 50);
            }
            else
            {
                AddLeftOverColumn(_grid, 33);
                AddLeftOverColumn(_grid, 33);
                AddLeftOverColumn(_grid, 33);
            }
            var list = gameContainer.PlayerList !.GetAllPlayersStartingWithSelf();

            var card = new ShowCardUI(_model, actionContainer, keeperContainer, EnumShowCategory.KeeperScreen);

            card.WidthRequest = 1000;
            AddControlToGrid(_grid, card, 0, 0);
            Grid.SetColumnSpan(card, 3);
            card.HorizontalOptions = LayoutOptions.Start;
            card.VerticalOptions   = LayoutOptions.Start;
            //hopefully it works when overrided version runs the methods for button and process.
            Button button;

            if (KeeperCategory == EnumKeeperCategory.Show)
            {
                button = GetGamingButton("Close Keeper Screen", nameof(KeeperShowViewModel.CloseKeeperAsync));
                AddControlToGrid(_grid, button, _grid.RowDefinitions.Count - 1, 0);
            }
            else if (KeeperCategory == EnumKeeperCategory.Process)
            {
                button = GetGamingButton(keeperContainer.ButtonText, CommandText);
                AddControlToGrid(_grid, button, _grid.RowDefinitions.Count - 1, 0);
            }
            else
            {
                throw new BasicBlankException("Keeper category not supported.  Rethink");
            }
            Grid.SetColumnSpan(button, 3);

            int x      = 0;
            int row    = 0;
            int column = 0;

            foreach (var player in list)
            {
                x += 1;
                if (x == 1 && player.PlayerCategory != EnumPlayerCategory.Self)
                {
                    throw new Exception("Failed to do self first");
                }
                KeeperHandXF hand   = new KeeperHandXF();
                var          keeper = keeperContainer.GetKeeperHand(player);
                hand.LoadList(keeper, "");
                if (x == 1)
                {
                    row    = 1;
                    column = 0;
                }
                else if (x == 2)
                {
                    row    = 1;
                    column = 1;
                }
                else if (x == 3 && gameContainer.PlayerList.Count() == 4)
                {
                    row    = 2;
                    column = 0;
                }
                else if (x == 3)
                {
                    row    = 1;
                    column = 2;
                }
                else if (x == 4 && gameContainer.PlayerList.Count() == 4)
                {
                    row    = 2;
                    column = 1;
                }
                else if (x == 4)
                {
                    row    = 2;
                    column = 0;
                }
                else if (x == 5)
                {
                    row    = 2;
                    column = 1;
                }
                else if (x == 6)
                {
                    row    = 2;
                    column = 2;
                }
                hand.MinimumWidthRequest = 300;
                AddControlToGrid(_grid, hand, row, column);
            }

            Content = _grid;
        }
示例#20
0
        public ActionFirstCardRandomView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackLayout mainStack = new StackLayout();
            FluxxHandXF thisHand  = new FluxxHandXF();

            thisHand.LoadList(actionContainer !.OtherHand !, "");
            thisHand.MinimumWidthRequest = 400;
            mainStack.Children.Add(thisHand);
            var button = GetGamingButton("Choose Card", nameof(ActionFirstCardRandomViewModel.ChooseCardAsync)); // i think

            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
示例#21
0
        public FluxxMainView(IEventAggregator aggregator,
                             TestOptions test,
                             FluxxVMData model,
                             ActionContainer actionContainer,
                             KeeperContainer keeperContainer,
                             FluxxGameContainer gameContainer
                             )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);
            _cardDetail1       = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.MainScreen);
            _deckGPile         = new BaseDeckWPF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsWPF>();
            _discardGPile      = new BasePileWPF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsWPF>();
            _score             = new ScoreBoardWPF();
            _playerHandWPF     = new BaseHandWPF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsWPF>();
            _cardDetail1.Width = 700;
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(FluxxMainViewModel.RestoreScreen)
                };
            }


            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_rule1);
            otherStack.Children.Add(_cardDetail1);
            otherStack.Children.Add(_goal1);
            mainStack.Children.Add(otherStack); //possibly forgot this.

            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(otherStack);
            var endButton = GetGamingButton("End Turn", nameof(FluxxMainViewModel.EndTurnAsync));

            otherStack.Children.Add(endButton);
            var button = GetGamingButton("Discard", nameof(FluxxMainViewModel.DiscardAsync));

            otherStack.Children.Add(button);

            ParentSingleUIContainer parent = new ParentSingleUIContainer()
            {
                Name = nameof(FluxxMainViewModel.PlayGiveScreen),
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top
            };

            otherStack.Children.Add(parent);

            button = GetGamingButton("Unselect All", nameof(FluxxMainViewModel.UnselectHandCards));
            otherStack.Children.Add(button);
            button = GetGamingButton("Select All", nameof(FluxxMainViewModel.SelectHandCards));
            otherStack.Children.Add(button);
            button = GetGamingButton("Show Keepers", nameof(FluxxMainViewModel.ShowKeepersAsync));
            otherStack.Children.Add(button);
            Grid tempGrid = new Grid();

            AddLeftOverColumn(tempGrid, 75);
            AddAutoColumns(tempGrid, 1);
            TrueFalseConverter tConverter = new TrueFalseConverter();

            tConverter.UseAbb = false;
            DetailGameInformationWPF detail1 = new DetailGameInformationWPF();

            detail1.Margin = new Thickness(3, 3, 3, 3);
            {
                var withBlock = detail1;
                withBlock.AddRow("Plays Left", nameof(FluxxMainViewModel.PlaysLeft));
                withBlock.AddRow("Hand Limit", nameof(FluxxMainViewModel.HandLimit));
                withBlock.AddRow("Keeper Limit", nameof(FluxxMainViewModel.KeeperLimit));
                withBlock.AddRow("Play Limit", nameof(FluxxMainViewModel.PlayLimit));
                withBlock.AddRow("Another Turn", nameof(FluxxMainViewModel.AnotherTurn), tConverter);
                withBlock.AddRow("Current Turn", nameof(FluxxMainViewModel.NormalTurn));
                withBlock.AddRow("Other Turn", nameof(FluxxMainViewModel.OtherTurn));
                withBlock.AddRow("Status", nameof(FluxxMainViewModel.Status));
                withBlock.AddRow("Draw Bonus", nameof(FluxxMainViewModel.DrawBonus));
                withBlock.AddRow("Play Bonus", nameof(FluxxMainViewModel.PlayBonus));
                withBlock.AddRow("Cards Drawn", nameof(FluxxMainViewModel.CardsDrawn));
                withBlock.AddRow("Cards Played", nameof(FluxxMainViewModel.CardsPlayed));
                withBlock.AddRow("Draw Rules", nameof(FluxxMainViewModel.DrawRules));
                withBlock.AddRow("Previous" + Constants.vbCrLf + "Bonus", nameof(FluxxMainViewModel.PreviousBonus));
            }
            mainStack.Children.Add(tempGrid);
            StackPanel finalStack = new StackPanel();

            AddControlToGrid(tempGrid, detail1, 0, 1);
            AddControlToGrid(tempGrid, finalStack, 0, 0);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            _keeperHand1.HandType  = HandObservable <KeeperCard> .EnumHandList.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.
            otherStack.Children.Add(_keeperHand1);
            finalStack.Children.Add(otherStack);
            _score.UseAbbreviationForTrueFalse = true; // this time has to be abbreviated
            _score.AddColumn("# In Hand", false, nameof(FluxxPlayerItem.ObjectCount));
            _score.AddColumn("# Of Keepers", false, nameof(FluxxPlayerItem.NumberOfKeepers));
            _score.AddColumn("Bread", false, nameof(FluxxPlayerItem.Bread), useTrueFalse: true);
            _score.AddColumn("Chocolate", false, nameof(FluxxPlayerItem.Chocolate), useTrueFalse: true);
            _score.AddColumn("Cookies", false, nameof(FluxxPlayerItem.Cookies), useTrueFalse: true);
            _score.AddColumn("Death", false, nameof(FluxxPlayerItem.Death), useTrueFalse: true);
            _score.AddColumn("Dreams", false, nameof(FluxxPlayerItem.Dreams), useTrueFalse: true);
            _score.AddColumn("Love", false, nameof(FluxxPlayerItem.Love), useTrueFalse: true);
            _score.AddColumn("Milk", false, nameof(FluxxPlayerItem.Milk), useTrueFalse: true);
            _score.AddColumn("Money", false, nameof(FluxxPlayerItem.Money), useTrueFalse: true);
            _score.AddColumn("Peace", false, nameof(FluxxPlayerItem.Peace), useTrueFalse: true);
            _score.AddColumn("Sleep", false, nameof(FluxxPlayerItem.Sleep), useTrueFalse: true);
            _score.AddColumn("Television", false, nameof(FluxxPlayerItem.Television), useTrueFalse: true);
            _score.AddColumn("The Brain", false, nameof(FluxxPlayerItem.TheBrain), useTrueFalse: true);
            _score.AddColumn("The Moon", false, nameof(FluxxPlayerItem.TheMoon), useTrueFalse: true);
            _score.AddColumn("The Rocket", false, nameof(FluxxPlayerItem.TheRocket), useTrueFalse: true);
            _score.AddColumn("The Sun", false, nameof(FluxxPlayerItem.TheSun), useTrueFalse: true);
            _score.AddColumn("The Toaster", false, nameof(FluxxPlayerItem.TheToaster), useTrueFalse: true);
            _score.AddColumn("Time", false, nameof(FluxxPlayerItem.Time), useTrueFalse: true);
            _score.AddColumn("War", false, nameof(FluxxPlayerItem.War), useTrueFalse: true);
            _playerHandWPF         = new FluxxHandWPF();
            _playerHandWPF.Divider = 1.2;
            finalStack.Children.Add(_playerHandWPF);
            _keeperHand1.MinWidth = 300;
            finalStack.Children.Add(_score);


            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 KeeperShowView(FluxxGameContainer gameContainer,
                       KeeperContainer keeperContainer,
                       ActionContainer actionContainer,
                       FluxxVMData model) : base(gameContainer, keeperContainer, actionContainer, model)
 {
 }
        public ActionFirstCardRandomView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackPanel   mainStack = new StackPanel();
            FluxxHandWPF thisHand  = new FluxxHandWPF();

            thisHand.LoadList(actionContainer !.OtherHand !, "");
            thisHand.MinWidth = 400;
            mainStack.Children.Add(thisHand);
            var button = GetGamingButton("Choose Card", nameof(ActionFirstCardRandomViewModel.ChooseCardAsync)); // i think

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
示例#24
0
 public BasicKeeperScreen(FluxxGameContainer gameContainer, KeeperContainer keeperContainer)
 {
     GameContainer    = gameContainer;
     KeeperContainer  = keeperContainer;
     CommandContainer = gameContainer.Command;
 }
        public ActionDirectionView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Direction";
            StackLayout stack = new StackLayout();

            SetUpMarginsOnParentControl(stack); //i think.
            ListChooserXF list = new ListChooserXF();

            list.ItemHeight = 60;
            list.LoadLists(actionContainer.Direction1 !);
            stack.Children.Add(list);
            var button = GetGamingButton("Choose Direction", nameof(ActionDirectionViewModel.DirectionAsync));

            button.HorizontalOptions = LayoutOptions.Start;
            button.VerticalOptions   = LayoutOptions.Start;
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
示例#26
0
        public ActionTradeHandsView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackLayout mainStack = new StackLayout();
            PlayerUI    player    = new PlayerUI(actionContainer, true, 50, 800);

            mainStack.Children.Add(player); // hopefully this simple.
            var button = ActionHelpers.GetKeeperButton();

            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
示例#27
0
        public ActionDirectionView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Direction";
            StackPanel stack = new StackPanel();
            SKRect     rect  = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(stack, rect); //i think.
            ListChooserWPF list = new ListChooserWPF();

            list.ItemHeight = 60;
            list.LoadLists(actionContainer.Direction1 !);
            stack.Children.Add(list);
            var button = GetGamingButton("Choose Direction", nameof(ActionDirectionViewModel.DirectionAsync));

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="element">the unique parts</param>
        /// <returns>this is supposed to be the content you set.</returns>
        internal static StackLayout GetFinalStack(View element, FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackLayout mainStack = new StackLayout();

            Grid tempGrid = new Grid();

            tempGrid.Margin = new Thickness(3, 3, 3, 5);
            AddLeftOverColumn(tempGrid, 50);
            AddLeftOverColumn(tempGrid, 50);
            AddAutoColumns(tempGrid, 1);
            var currentCard = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.MainAction);

            currentCard.WidthRequest = 700;
            AddControlToGrid(tempGrid, currentCard, 0, 0);
            var actionCard = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.CurrentAction);

            AddControlToGrid(tempGrid, actionCard, 0, 1);
            actionCard.WidthRequest = 700; // since it does not seem to autosize.
            GoalHandXF goal1 = new GoalHandXF();

            goal1.LoadList(actionContainer.PrivateGoals !, "");
            AddControlToGrid(tempGrid, goal1, 0, 2);
            mainStack.Children.Add(tempGrid);
            tempGrid = new Grid();
            AddLeftOverColumn(tempGrid, 50);
            AddLeftOverColumn(tempGrid, 50);
            var yourCards = new FluxxHandXF();

            yourCards.LoadList(actionContainer.YourCards !, "");
            AddControlToGrid(tempGrid, yourCards, 0, 0);
            var yourKeepers = new KeeperHandXF();

            yourKeepers.MinimumWidthRequest = 400;
            yourKeepers.LoadList(actionContainer.YourKeepers !, "");
            AddControlToGrid(tempGrid, yourKeepers, 0, 1);
            tempGrid.Margin = new Thickness(3, 3, 3, 5);
            mainStack.Children.Add(tempGrid);
            mainStack.Children.Add(element);
            return(mainStack);
        }
示例#29
0
        public FluxxMainView(IEventAggregator aggregator,
                             TestOptions test,
                             FluxxVMData model,
                             ActionContainer actionContainer,
                             KeeperContainer keeperContainer,
                             FluxxGameContainer gameContainer
                             )
        {
            _aggregator    = aggregator;
            _model         = model;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);
            _cardDetail1 = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.MainScreen);
            _cardDetail1.WidthRequest = 700;
            _deckGPile     = new BaseDeckXF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsXF>();
            _discardGPile  = new BasePileXF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsXF>();
            _score         = new ScoreBoardXF();
            _playerHandWPF = new BaseHandXF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsXF>();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(FluxxMainViewModel.RestoreScreen));
            }

            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            otherStack.Children.Add(_rule1);
            otherStack.Children.Add(_cardDetail1);
            otherStack.Children.Add(_goal1);
            mainStack.Children.Add(otherStack); //possibly forgot this.

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);
            var endButton = GetSmallerButton("End Turn", nameof(FluxxMainViewModel.EndTurnAsync));

            otherStack.Children.Add(endButton);
            var button = GetSmallerButton("Discard", nameof(FluxxMainViewModel.DiscardAsync));

            otherStack.Children.Add(button);

            ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(FluxxMainViewModel.PlayGiveScreen))
            {
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Start
            };

            otherStack.Children.Add(parent);

            button = GetSmallerButton("Unselect All", nameof(FluxxMainViewModel.UnselectHandCards));
            otherStack.Children.Add(button);
            button = GetSmallerButton("Select All", nameof(FluxxMainViewModel.SelectHandCards));
            otherStack.Children.Add(button);
            button = GetSmallerButton("Show Keepers", nameof(FluxxMainViewModel.ShowKeepersAsync));
            otherStack.Children.Add(button);
            Grid tempGrid = new Grid();

            AddLeftOverColumn(tempGrid, 75);
            AddAutoColumns(tempGrid, 1);
            TrueFalseConverter tConverter = new TrueFalseConverter();

            tConverter.UseAbb = false;
            DetailGameInformationXF detail1 = new DetailGameInformationXF();

            detail1.Margin = new Thickness(3, 3, 3, 3);
            {
                var withBlock = detail1;
                withBlock.AddRow("Plays Left", nameof(FluxxMainViewModel.PlaysLeft));
                withBlock.AddRow("Hand Limit", nameof(FluxxMainViewModel.HandLimit));
                withBlock.AddRow("Keeper Limit", nameof(FluxxMainViewModel.KeeperLimit));
                withBlock.AddRow("Play Limit", nameof(FluxxMainViewModel.PlayLimit));
                withBlock.AddRow("Another Turn", nameof(FluxxMainViewModel.AnotherTurn), tConverter);
                withBlock.AddRow("Current Turn", nameof(FluxxMainViewModel.NormalTurn));
                withBlock.AddRow("Other Turn", nameof(FluxxMainViewModel.OtherTurn));
                withBlock.AddRow("Status", nameof(FluxxMainViewModel.Status));
                withBlock.AddRow("Draw Bonus", nameof(FluxxMainViewModel.DrawBonus));
                withBlock.AddRow("Play Bonus", nameof(FluxxMainViewModel.PlayBonus));
                withBlock.AddRow("Cards Drawn", nameof(FluxxMainViewModel.CardsDrawn));
                withBlock.AddRow("Cards Played", nameof(FluxxMainViewModel.CardsPlayed));
                withBlock.AddRow("Draw Rules", nameof(FluxxMainViewModel.DrawRules));
                withBlock.AddRow("Previous" + Constants.vbCrLf + "Bonus", nameof(FluxxMainViewModel.PreviousBonus));
            }
            mainStack.Children.Add(tempGrid);
            StackLayout finalStack = new StackLayout();

            AddControlToGrid(tempGrid, detail1, 0, 1);
            AddControlToGrid(tempGrid, finalStack, 0, 0);

            otherStack             = new StackLayout();
            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(otherStack);     //possibly forgot this.
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile); // can reposition or not even have as well.

            otherStack.Children.Add(_keeperHand1);
            finalStack.Children.Add(otherStack);
            _score.UseAbbreviationForTrueFalse = true; // this time has to be abbreviated
            _score.AddColumn("# In Hand", false, nameof(FluxxPlayerItem.ObjectCount));
            _score.AddColumn("# Of Keepers", false, nameof(FluxxPlayerItem.NumberOfKeepers));
            _score.AddColumn("Bread", false, nameof(FluxxPlayerItem.Bread), useTrueFalse: true);
            _score.AddColumn("Chocolate", false, nameof(FluxxPlayerItem.Chocolate), useTrueFalse: true);
            _score.AddColumn("Cookies", false, nameof(FluxxPlayerItem.Cookies), useTrueFalse: true);
            _score.AddColumn("Death", false, nameof(FluxxPlayerItem.Death), useTrueFalse: true);
            _score.AddColumn("Dreams", false, nameof(FluxxPlayerItem.Dreams), useTrueFalse: true);
            _score.AddColumn("Love", false, nameof(FluxxPlayerItem.Love), useTrueFalse: true);
            _score.AddColumn("Milk", false, nameof(FluxxPlayerItem.Milk), useTrueFalse: true);
            _score.AddColumn("Money", false, nameof(FluxxPlayerItem.Money), useTrueFalse: true);
            _score.AddColumn("Peace", false, nameof(FluxxPlayerItem.Peace), useTrueFalse: true);
            _score.AddColumn("Sleep", false, nameof(FluxxPlayerItem.Sleep), useTrueFalse: true);
            _score.AddColumn("Television", false, nameof(FluxxPlayerItem.Television), useTrueFalse: true);
            _score.AddColumn("The Brain", false, nameof(FluxxPlayerItem.TheBrain), useTrueFalse: true);
            _score.AddColumn("The Moon", false, nameof(FluxxPlayerItem.TheMoon), useTrueFalse: true);
            _score.AddColumn("The Rocket", false, nameof(FluxxPlayerItem.TheRocket), useTrueFalse: true);
            _score.AddColumn("The Sun", false, nameof(FluxxPlayerItem.TheSun), useTrueFalse: true);
            _score.AddColumn("The Toaster", false, nameof(FluxxPlayerItem.TheToaster), useTrueFalse: true);
            _score.AddColumn("Time", false, nameof(FluxxPlayerItem.Time), useTrueFalse: true);
            _score.AddColumn("War", false, nameof(FluxxPlayerItem.War), useTrueFalse: true);


            _playerHandWPF.Divider = 1.2;
            finalStack.Children.Add(_playerHandWPF);
            _keeperHand1.MinimumWidthRequest = 300;
            finalStack.Children.Add(_score);


            _deckGPile.Margin = new Thickness(5, 5, 5, 5);

            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }

            GamePackageViewModelBinder.ManuelElements.Clear();     //often times i have to add manually.

            FluxxSaveInfo save = cons !.Resolve <FluxxSaveInfo>(); //usually needs this part for multiplayer games.

            _score !.LoadLists(save.PlayerList);
            _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think
            _discardGPile !.Init(_model.Pile1 !, "");            // may have to be here (well see)
            _discardGPile.StartListeningDiscardPile();           // its the main one.

            _deckGPile !.Init(_model.Deck1 !, "");               // try here.  may have to do something else as well (?)
            _deckGPile.StartListeningMainDeck();
            _rule1.LoadControls(_gameContainer);
            _goal1.LoadList(_model.Goal1 !, "");
            _keeperHand1.LoadList(_model.Keeper1 !, "");

            Content = mainStack;
        }