예제 #1
0
 internal void Proceed(Decision decision, Duel duel)
 {
     if (decision != null)
     {
         duel.ClearAwaitingChoice();
     }
     if (decision == null && duel.AwaitingChoice != null)
     {
         return;
     }
     else if (PendingReplacementEffects.Any())
     {
         PendingReplacementEffect = PendingReplacementEffects.Single(x => x.Id == (decision as GuidDecision).Decision.Single());
         PendingReplacementEffects.Clear();
         Proceed(null, duel);
     }
     else if (PendingReplacementEffect != null)
     {
         PendingReplacementEffect.Replace(duel, decision);
         if (duel.AwaitingChoice == null)
         {
             UsedReplacementEffects.Add(PendingReplacementEffect.Id);
             PendingReplacementEffect = null;
         }
         Proceed(null, duel);
     }
     else if (duel.AwaitingEvents.Any())
     {
         CheckAwaitingEvents(duel);
     }
     else if (State == StepState.TurnBasedAction)
     {
         CheckTurnBasedAction(duel, decision);
     }
     else if (State == StepState.CheckGameOver)
     {
         CheckGameOver(duel);
     }
     else if (State == StepState.ResolveSpell)
     {
         ResolveSpells(duel, decision);
     }
     else if (State == StepState.StateBasedAction)
     {
         CheckStateBasedActions(duel);
     }
     else if (State == StepState.ShieldTrigger)
     {
         CheckShieldTriggers(duel, decision);
     }
     else if (State == StepState.SelectAbility)
     {
         SelectAbility(duel, decision);
     }
     else if (State == StepState.ResolveAbility)
     {
         ResolveAbility(duel, decision);
     }
     else if (State == StepState.PriorityAction)
     {
         CheckPriority(duel, decision);
     }
     else if (State != StepState.Over)
     {
         throw new ArgumentOutOfRangeException(State.ToString());
     }
 }