示例#1
0
        private static void PerformMoveWithWaypoint(ShipMove move)
        {
            switch (move.Code)
            {
            case 'F':
                MoveShip(move.Value);
                break;

            case 'N':
            case 'S':
            case 'E':
            case 'W':
                MoveWaypoint(move.Code, move.Value);
                break;

            case 'L':
            case 'R':
                RotateWaypoint(move.Code, move.Value);
                break;

            default:
                break;
            }
        }
示例#2
0
        private static void PerformMove(ShipMove move)
        {
            switch (move.Code)
            {
            case 'F':
                Move(_ship.FacingDirection, move.Value);
                break;

            case 'N':
            case 'S':
            case 'E':
            case 'W':
                Move(move.Code, move.Value);
                break;

            case 'L':
            case 'R':
                Rotate(move.Code, move.Value);
                break;

            default:
                break;
            }
        }