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; }
public FerryState(GridPoint position, FerryMovementDirection heading) { Position = position; Heading = heading; }