Exemplo n.º 1
0
        public static MovementDirection GetMovementDirectionFromHeading(FerryMovementDirection heading)
        {
            MovementDirection direction;

            if (FerryMovementDirection.East.Equals(heading))
            {
                direction = MovementDirection.Right;
            }
            else if (FerryMovementDirection.North.Equals(heading))
            {
                direction = MovementDirection.Up;
            }
            else if (FerryMovementDirection.West.Equals(heading))
            {
                direction = MovementDirection.Left;
            }
            else if (FerryMovementDirection.South.Equals(heading))
            {
                direction = MovementDirection.Down;
            }
            else
            {
                throw new Exception($"Invalid heading: {heading}");
            }
            return(direction);
        }
 public FerryMovementInstruction(FerryMovementDirection ferryMovementDirection, int value)
 {
     MovementDirection = ferryMovementDirection;
     Value             = value;
 }
Exemplo n.º 3
0
 public FerryState(GridPoint position, FerryMovementDirection heading)
 {
     Position = position;
     Heading  = heading;
 }