public ActionFirstCardRandomViewModel(FluxxGameContainer gameContainer,
                                       ActionContainer actionContainer,
                                       KeeperContainer keeperContainer,
                                       FluxxDelegates delegates,
                                       IFluxxEvent fluxxEvent,
                                       BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
 }
Example #2
0
 public ActionEverybodyGetsOneViewModel(FluxxGameContainer gameContainer,
                                        ActionContainer actionContainer,
                                        KeeperContainer keeperContainer,
                                        FluxxDelegates delegates,
                                        IFluxxEvent fluxxEvent,
                                        BasicActionLogic basicActionLogic) : base(gameContainer, actionContainer, keeperContainer, delegates, fluxxEvent, basicActionLogic)
 {
 }
Example #3
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;
 }
        public async Task ChooseCardAsync()
        {
            if (ActionContainer.IndexPlayer == -1)
            {
                throw new BasicBlankException("Must have the player chosen in order to use what you take from another player");
            }
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.CardChosenToPlayAtAsync(ActionContainer.OtherHand.ObjectSelected(), ActionContainer.IndexPlayer);
        }
        public async Task ChooseCardAsync()
        {
            if (ActionContainer.OtherHand !.ObjectSelected() == 0)
            {
                await UIPlatform.ShowMessageAsync("Must choose a card");

                return;
            }
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.FirstCardRandomChosenAsync(ActionContainer.OtherHand.ObjectSelected());
        }
Example #6
0
        public async Task DiscardRulesAsync()
        {
            await BasicActionLogic.ShowMainScreenAgainAsync();

            if (ActionContainer.Rule1 !.SelectionMode == ListViewPicker.EnumSelectionMode.SingleItem)
            {
                await FluxxEvent.RuleTrashedAsync(ActionContainer.IndexRule);

                return;
            }
            await FluxxEvent.RulesSimplifiedAsync(ActionContainer.TempRuleList !);
        }
        public async Task DrawUseAsync()
        {
            if (ActionContainer.TempHand !.ObjectSelected() == 0)
            {
                await UIPlatform.ShowMessageAsync("Must choose a card");

                return;
            }
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.CardToUseAsync(ActionContainer.TempHand.ObjectSelected());
        }
Example #8
0
        public async Task GiveCardsAsync()
        {
            CustomBasicList <int> thisList;

            if (ActionContainer.TempHand !.AutoSelect == HandObservable <FluxxCardInformation> .EnumAutoType.SelectOneOnly)
            {
                if (ActionContainer.TempHand.ObjectSelected() == 0)
                {
                    await UIPlatform.ShowMessageAsync("Must choose a card to give to a player");

                    return;
                }
                thisList = new CustomBasicList <int>()
                {
                    ActionContainer.TempHand.ObjectSelected()
                };
                await BasicActionLogic.ShowMainScreenAgainAsync();

                await FluxxEvent.ChoseForEverybodyGetsOneAsync(thisList, ActionContainer.IndexPlayer);

                return;
            }
            if (ActionContainer.TempHand.HowManySelectedObjects > 2)
            {
                await UIPlatform.ShowMessageAsync("Cannot choose more than 2 cards to give to player");

                return;
            }
            int index        = ActionContainer.GetPlayerIndex(ActionContainer.IndexPlayer);
            int howManySoFar = GameContainer.EverybodyGetsOneList.Count(items => items.Player == index);

            howManySoFar += ActionContainer.TempHand.HowManySelectedObjects;
            int extras = GameContainer.IncreaseAmount();
            int mosts  = extras + 1;

            if (howManySoFar > mosts)
            {
                await UIPlatform.ShowMessageAsync($"Cannot choose more than 2 cards each for the player.  So far; you chose {howManySoFar} cards.");

                return;
            }
            var finalList = ActionContainer.TempHand.ListSelectedObjects();

            thisList = finalList.GetDeckListFromObjectList();
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.ChoseForEverybodyGetsOneAsync(thisList, ActionContainer.IndexPlayer);
        }
Example #9
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;
 }
        public async Task ChoosePlayerAsync()
        {
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.TradeHandsAsync(ActionContainer.IndexPlayer);
        }
        public async Task DirectionAsync()
        {
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.DirectionChosenAsync(ActionContainer.IndexDirection);
        }
        public async Task SelectCardAsync()
        {
            await BasicActionLogic.ShowMainScreenAgainAsync();

            await FluxxEvent.DoAgainSelectedAsync(ActionContainer.IndexCard);
        }