예제 #1
0
파일: For.cs 프로젝트: hogeschool/TIRDES01
 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);
 }
예제 #2
0
 public override InstructionResult Execute(float dt)
 {
     switch (body.Execute(dt))
       {
     case InstructionResult.Done:
       body = body.Reset();
       return InstructionResult.Running;
     case InstructionResult.DoneAndCreateAsteroid:
       body = body.Reset();
       return InstructionResult.RunningAndCreateAsteroid;
     case InstructionResult.Running:
       return InstructionResult.Running;
     case InstructionResult.RunningAndCreateAsteroid:
       return InstructionResult.RunningAndCreateAsteroid;
       }
       return InstructionResult.Running;
 }
예제 #3
0
파일: For.cs 프로젝트: hogeschool/TIRDES01
 public override InstructionResult Execute(float dt)
 {
     if (i >= end)
     return InstructionResult.Done;
       else
       {
     switch (body.Execute(dt))
     {
       case InstructionResult.Done:
     i++;
     body = getBody(i);
     return InstructionResult.Running;
       case InstructionResult.DoneAndCreateAsteroid:
     i++;
     body = getBody(i);
     return InstructionResult.RunningAndCreateAsteroid;
       case InstructionResult.Running:
     return InstructionResult.Running;
       case InstructionResult.RunningAndCreateAsteroid:
     return InstructionResult.RunningAndCreateAsteroid;
     }
     return InstructionResult.Done;
       }
 }
예제 #4
0
 public Repeat(Instruction body)
 {
     this.body = body;
 }
예제 #5
0
 public Semicolon(Instruction A, Instruction B)
 {
     this.A = A;
       this.B = B;
 }