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 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);
        }
Exemple #3
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);
        }
        /// <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);
        }
        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);
        }