示例#1
0
 public void SetResult(int index)
 {
     Result = new ChosenPlayable {
         Playable = _playables[index]
     };
     LogFile.Debug("Move is {0}", _playables[index]);
 }
示例#2
0
 public MachineHandler()
 {
     Result = new ChosenPlayable {
         Playable = new Pass()
     };
     _executor = new MachinePlanExecutor(this);
 }
示例#3
0
            protected override void ExecuteQuery()
            {
                var activationParameters = new ActivationParameters
                {
                    PayManaCost = D._p.PayManaCost
                };

                var spellPrerequisites = SelectSpell();

                if (spellPrerequisites == null)
                {
                    return;
                }

                UiHelpers.SelectX(spellPrerequisites, activationParameters, canCancel: false);
                UiHelpers.SelectTargets(spellPrerequisites, activationParameters, canCancel: false);

                var playable = new PlayableSpell
                {
                    Card = D._p.Card,
                    ActivationParameters = activationParameters,
                    Index = spellPrerequisites.Index
                };

                Result = new ChosenPlayable {
                    Playable = playable
                };
            }
示例#4
0
            protected override void ExecuteQuery()
            {
                if (Ui.Configuration.ShouldAutoPass(
                        step:  Game.Turn.Step,
                        isActiveTurn: D.Controller.IsActive,
                        anyPlayerPlayedSomething: Game.Turn.Events.HasAnythingBeenPlayedOrActivatedDuringThisStep))
                {
                    Result = new ChosenPlayable {
                        Playable = new Pass()
                    };
                    return;
                }

                var dialog = Ui.Dialogs.Priority.Create();

                Ui.Shell.ShowModalDialog(dialog, DialogType.Small, InteractionState.PlaySpellsOrAbilities);
                Result = new ChosenPlayable {
                    Playable = dialog.Playable ?? new Pass()
                };
            }
示例#5
0
        public ScenarioStep Cast(Action <ScenarioActivation> init)
        {
            var activation = new ScenarioActivation();

            init(activation);

            var result = new ChosenPlayable
            {
                Playable = new ScenarioPlayableSpell
                {
                    Card = activation.Card,
                    ActivationParameters = new ActivationParameters
                    {
                        Targets = activation.GetTargets(),
                        X       = activation.X
                    },
                    Index = activation.Index
                }
            };

            _results.Add(new DecisionResult(result, activation.Card.Controller, activation.StackShouldBeEmpty));
            return(this);
        }