Ejemplo n.º 1
0
 public Registers()
 {
     registers = new ProgramCard[5];
     for (var i = 1; i <= 5; i++)
     {
         this[i] = null;
     }
 }
Ejemplo n.º 2
0
        internal void ExecuteProgramCard(AI ai, ProgramCard card)
        {
            switch (card.CardAction)
            {
            case ProgramCardAction.RotateLeft:
                ai.Direction = TileDirectionUtil.TurnLeft(ai.Direction);
                break;

            case ProgramCardAction.RotateRight:
                ai.Direction = TileDirectionUtil.TurnRight(ai.Direction);
                break;

            case ProgramCardAction.UTurn:
                ai.Direction = TileDirectionUtil.Opposite(ai.Direction);
                break;

            case ProgramCardAction.Move1:
                MoveAIOnce(ai);
                break;

            case ProgramCardAction.Move2:
                MoveAIOnce(ai);
                MoveAIOnce(ai);
                break;

            case ProgramCardAction.Move3:
                MoveAIOnce(ai);
                MoveAIOnce(ai);
                MoveAIOnce(ai);
                break;

            case ProgramCardAction.BackUp:
                MoveAIOnce(ai, TileDirectionUtil.Opposite(ai.Direction));
                break;
            }
        }