Пример #1
0
        private void OnPhaseChange(PhaseChangingEvent evt)
        {
            if (StackNotEmpty())
            {
                evt.SetPreventPhase();
                while (StackNotEmpty())
                {
                    var abi = stack.Pop();
                    if(!abi.PreventResolving)
                        this.ActionManager.Queue(new FireAbilityAction(abi));

                    this.EventManager.Raise(new DequeueAbilityEvent(abi));
                }
            }
        }
Пример #2
0
        private Phases GetNextPhase( out bool phaseReset)
        {
            Phases next;
            var evt = new PhaseChangingEvent();
            this.EventManager.Raise(evt);

            if (evt.PreventedPhaseChange)
            {
                phaseReset = false;
                return currentPhase;
            }

            if (currentPhase == Phases.End)
            {
                phaseReset = true;
                next = Phases.Draw;
            }
            else
            {
                phaseReset = false;
                next = currentPhase + 1;

            }
            return next;
        }