示例#1
0
            protected override void ExecuteQuery()
            {
                ChosenCards chosenCards = null;

                while (true)
                {
                    chosenCards = new ChosenCards();

                    var validatorParameters = new TargetValidatorParameters
                    {
                        IsValidTarget = p => D._p.Validator.IsValidCard(p.Target.Card()),
                        IsValidZone   = p => p.Zone == D._p.Zone && p.ZoneOwner == D.Controller,
                        MinCount      = D._p.MinCount,
                        MaxCount      = D._p.MaxCount == null ? null : (Value)D._p.MaxCount.Value,
                        Message       = D._p.Text,
                    };

                    var validator = new TargetValidator(validatorParameters);
                    validator.Initialize(Game, D.Controller, D._p.OwningCard);

                    var selectTargetParameters = new SelectTargetParameters
                    {
                        Validator    = validator,
                        Instructions = D._p.Instructions
                    };

                    var dialog = Ui.Dialogs.SelectTarget.Create(selectTargetParameters);
                    Ui.Shell.ShowModalDialog(dialog, DialogType.Small, InteractionState.SelectTarget);

                    foreach (Card card in dialog.Selection)
                    {
                        chosenCards.Add(card);

                        if (card.Is().Aura&& D._p.AurasNeedTarget)
                        {
                            var auraTarget = SelectAuraTarget(card);

                            if (auraTarget == null)
                            {
                                continue;
                            }

                            chosenCards.Add(auraTarget);
                        }
                    }

                    break;
                }

                Result = chosenCards;
            }
示例#2
0
 public MachineHandler()
 {
     Result = new ChosenCards();
 }
示例#3
0
 public MachineHandler()
 {
     Result    = new ChosenCards();
     _executor = new MachinePlanExecutor(this);
 }
示例#4
0
 public ScenarioHandler()
 {
     Result = new ChosenCards();
 }