Class JourneyPlanner
- Namespace
- JourneyPlanner
- Assembly
- Project.dll
A tool to help plan pedestrian journeys in a large city's central business district which is laid out in a 10-block grid.
public class JourneyPlanner
- Inheritance
-
JourneyPlanner
- Inherited Members
Constructors
JourneyPlanner(int)
When constructed a journey planner needs to know how many minutes it takes you to walk one city block on average.
public JourneyPlanner(int walkingSpeed)
Parameters
walkingSpeedinthow many minutes it takes you to walk one block
Exceptions
- Exception
if the given speed is zero or negative
Properties
JourneyTime
Returns the journey time from the origin to the destination (calculated using Manhattan distances).
public int JourneyTime { get; }
Property Value
- int
your journey time in minutes
Methods
SetDestination(int, int)
Sets the destination for your planned journey (provided a valid coordinate is supplied).
public bool SetDestination(int X, int Y)
Parameters
Returns
- bool
true if a valid destination has been supplied, false otherwise
SetOrigin(int, int)
Sets the origin for your planned journey (provided a valid coordinate is supplied).
public bool SetOrigin(int X, int Y)
Parameters
Returns
- bool
true if a valid origin has been supplied, false otherwise