Exemplo n.º 1
0
 public For(int start, int end, Func<int, Instruction> getBody)
 {
     this.i = start;
     this.start = start;
     this.end = end;
     this.getBody = getBody;
     this.body = getBody(i);
 }
Exemplo n.º 2
0
 public override IResult Execute(float dt)
 {
     switch (body.Execute(dt))
     {
         case IResult.Done:
             body = body.Reset();
             return IResult.Running;
         case IResult.DoneAndCreate:
             body = body.Reset();
             return IResult.RunningAndCreate;
         case IResult.Running:
             return IResult.Running;
         case IResult.RunningAndCreate:
             return IResult.RunningAndCreate;
     }
     return IResult.Running;
 }
Exemplo n.º 3
0
 public override IResult Execute(float dt)
 {
     if (i >= end)
         return IResult.Done;
     else
     {
         switch (body.Execute(dt))
         {
             case IResult.Done:
                 i++;
                 body = getBody(i);
                 return IResult.Running;
             case IResult.DoneAndCreate:
                 i++;
                 body = getBody(i);
                 return IResult.RunningAndCreate;
             case IResult.Running:
                 return IResult.Running;
             case IResult.RunningAndCreate:
                 return IResult.RunningAndCreate;
         }
         return IResult.Done;
     }
 }
Exemplo n.º 4
0
 public Repeat(Instruction body)
 {
     this.body = body;
 }
Exemplo n.º 5
0
 public Next(Instruction One, Instruction Two)
 {
     this.One = One;
     this.Two = Two;
 }