Beispiel #1
0
        // Returns true if the player passed
        public bool ResolveCurrentPriority()
        {
ResetChoice:
            PriorityChoice choice = new PriorityChoice();

            PushChoice(choice);
            switch (choice.FirstChoice.type)
            {
            case PriorityOption.OptionType.PassPriority:
                return(true);

            case PriorityOption.OptionType.CastSpell:
            {
                OID source = choice.FirstChoice.source;

                if (!PushEvent(new CastSpellEvent(source)))
                {
                    goto ResetChoice;
                }

                break;
            }

            case PriorityOption.OptionType.PlayLand:
                if (!PushEvent(new PlayLandEvent(choice.FirstChoice.source)))
                {
                    goto ResetChoice;
                }
                break;

            case PriorityOption.OptionType.ActivateAbility:
            {
                OID source = choice.FirstChoice.source;
                ActivatedAbility ability = choice.FirstChoice.activatedAbility;

                if (!PushEvent(new ActivateAbilityEvent(source, ability)))
                {
                    goto ResetChoice;
                }

                break;
            }

            case PriorityOption.OptionType.ManaAbility:
            {
                OID         source  = choice.FirstChoice.source;
                ManaAbility ability = choice.FirstChoice.activatedAbility as ManaAbility;

                if (!PushEvent(new ActivateAbilityEvent(source, ability)))
                {
                    goto ResetChoice;
                }

                break;
            }

            default:
                throw new NotImplementedException();
            }
            return(false);
        }
Beispiel #2
0
 public ResolveManaAbilityEvent(OID source, ManaAbility ability) : base(source)
 {
     this.ability = ability;
 }