Exemplo n.º 1
0
        public override async Task <PhaseResult <string> > DoPhase1Async(PhaseContext1 context, IBattlePhases processor)
        {
            Console.Write($"{context.X} + {context.Y} + Z >");
            var input = Console.ReadLine();

            if (input == "cancel" || input is null)
            {
                return(new Cancelled <string>());
            }

            return(await processor.HandlePhase2Async(context, int.Parse(input)));
        }
Exemplo n.º 2
0
 public abstract Task <PhaseResult <string> > DoPhase1Async(PhaseContext1 context, IBattlePhases handler);
Exemplo n.º 3
0
        public async Task <PhaseResult <string> > HandlePhase2Async(PhaseContext1 context, int z)
        {
            var phase = new PhaseContext2(context, z);

            return(await HandlePhaseFlowAsync(() => _logic.DoPhase2Async(phase, this)));
        }
Exemplo n.º 4
0
        public async Task <PhaseResult <string> > HandlePhase1Async(int x, int y)
        {
            var phase = new PhaseContext1(x, y);

            return(await HandlePhaseFlowAsync(() => _logic.DoPhase1Async(phase, this)));
        }
Exemplo n.º 5
0
 public PhaseContext2(PhaseContext1 context1, int z)
 {
     Context1 = context1;
     Z        = z;
 }