Beispiel #1
0
        public void Take(Instruction instruction)
        {
            switch (instruction.Action)
            {
            case 'L':
                Direction = Compass.TurnLeft(instruction.Value, Direction);
                break;

            case 'R':
                Direction = Compass.TurnRight(instruction.Value, Direction);
                break;

            case 'F':
                HandleDirection(Direction, instruction.Value);
                break;

            default:
                HandleDirection(instruction.Action, instruction.Value);
                break;
            }
        }