Esempio n. 1
0
 public KeeperContainer(FluxxGameContainer gameContainer, FluxxDelegates delegates)
 {
     _gameContainer = gameContainer;
     _delegates     = delegates;
     KeeperHandList = new CustomBasicList <HandObservable <KeeperCard> >();
     CardDetail     = new DetailCardObservable();
 }
Esempio n. 2
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;
        }
Esempio n. 3
0
 public FluxxVMData(IEventAggregator aggregator, CommandContainer command, TestOptions test, IAsyncDelayer delayer)
 {
     Deck1              = new DeckObservablePile <FluxxCardInformation>(aggregator, command);
     Pile1              = new PileObservable <FluxxCardInformation>(aggregator, command);
     PlayerHand1        = new HandObservable <FluxxCardInformation>(command);
     Keeper1            = new HandObservable <KeeperCard>(command);
     Goal1              = new HandObservable <GoalCard>(command);
     Goal1.Text         = "Goal Cards";
     Goal1.Maximum      = 3;
     Goal1.AutoSelect   = HandObservable <GoalCard> .EnumAutoType.SelectOneOnly;
     Keeper1.AutoSelect = HandObservable <KeeperCard> .EnumAutoType.SelectAsMany;
     Keeper1.Text       = "Your Keepers";
     CardDetail         = new DetailCardObservable();
     _test              = test;
     _delayer           = delayer;
 }
Esempio n. 4
0
        public ActionContainer(CommandContainer command, IGamePackageResolver resolver, FluxxGameContainer gameContainer, FluxxDelegates delegates)
        {
            delegates.RefreshEnables = RefreshEnables;
            _command               = command;
            _gameContainer         = gameContainer;
            ActionDetail           = new DetailCardObservable();
            CurrentDetail          = new DetailCardObservable();
            YourKeepers            = new HandObservable <KeeperCard>(command);
            YourKeepers.AutoSelect = HandObservable <KeeperCard> .EnumAutoType.ShowObjectOnly;
            YourKeepers.Text       = "Your Keepers";
            YourKeepers.SendAlwaysEnable(this);
            YourKeepers.ConsiderSelectOneAsync += YourKeepers_ConsiderSelectOneAsync;
            PrivateGoals                         = new HandObservable <GoalCard>(command);
            PrivateGoals.AutoSelect              = HandObservable <GoalCard> .EnumAutoType.ShowObjectOnly;
            PrivateGoals.Text                    = "Goal Cards";
            PrivateGoals.Maximum                 = 3;
            PrivateGoals.ConsiderSelectOneAsync += PrivateGoals_ConsiderSelectOneAsync;
            //handlist hook up when necessary.
            YourCards      = new HandObservable <FluxxCardInformation>(command);
            YourCards.Text = "Your Cards";
            YourCards.ConsiderSelectOneAsync += YourCards_ConsiderSelectOneAsync;
            YourCards.AutoSelect              = HandObservable <FluxxCardInformation> .EnumAutoType.ShowObjectOnly;
            OtherHand                         = new HandObservable <FluxxCardInformation>(command);
            OtherHand.AutoSelect              = HandObservable <FluxxCardInformation> .EnumAutoType.SelectOneOnly;
            OtherHand.Text                    = "Other Player's Cards";
            OtherHand.ConsiderSelectOneAsync += YourCards_ConsiderSelectOneAsync;
            OtherHand.SendEnableProcesses(this, () =>
            {
                //if (_thisMod.FluxxScreenUsed != EnumActionScreen.ActionScreen)
                //    return false;
                if (OtherHand.Visible == false)
                {
                    return(false);
                }
                return(ActionCategory == EnumActionCategory.FirstRandom || ActionCategory == EnumActionCategory.UseTake);
            });

            TempHand                         = new HandObservable <FluxxCardInformation>(command);
            TempHand.AutoSelect              = HandObservable <FluxxCardInformation> .EnumAutoType.SelectOneOnly;
            TempHand.Text                    = "Temporary Cards";
            TempHand.ConsiderSelectOneAsync += YourCards_ConsiderSelectOneAsync;
            TempHand.SendEnableProcesses(this, () =>
            {
                return(ActionCategory == EnumActionCategory.Everybody1 || ActionCategory == EnumActionCategory.DrawUse);
            });
            Direction1 = new ListViewPicker(command, resolver);
            Direction1.ItemSelectedAsync += Direction1_ItemSelectedAsync;
            Direction1.IndexMethod        = ListViewPicker.EnumIndexMethod.ZeroBased;
            Direction1.LoadTextList(new CustomBasicList <string> {
                "Left", "Right"
            });
            Rule1 = new ListViewPicker(command, resolver);
            Rule1.ItemSelectedAsync += Rule1_ItemSelectedAsync;
            Rule1.IndexMethod        = ListViewPicker.EnumIndexMethod.ZeroBased;
            Rule1.SendEnableProcesses(this, () =>
            {
                return(ActionCategory == EnumActionCategory.Rules);
            });
            Player1 = new ListViewPicker(command, resolver);
            Player1.ItemSelectedAsync += Player1_ItemSelectedAsync;
            Player1.IndexMethod        = ListViewPicker.EnumIndexMethod.ZeroBased;
            Player1.SendEnableProcesses(this, () => CanEnableChoosePlayer());

            CardList1 = new ListViewPicker(command, resolver);
            CardList1.ItemSelectedAsync += CardList1_ItemSelectedAsync;
            CardList1.IndexMethod        = ListViewPicker.EnumIndexMethod.ZeroBased;
            CardList1.SendEnableProcesses(this, () =>
            {
                return(ActionCategory == EnumActionCategory.DoAgain);
            });
        }