C# Class AbstractedSheep.ShuttleTrackerWorld.World

Show file Open project: AbstractedSheep/Shuttle-Tracker Class Usage Examples

Public Methods

Method Description
AddOrUpdateShuttle ( int shuttleId, Coordinate location, string name, int bearing, string cardinalPoint, int speed, int route = -1 ) : void

Adds a shuttle to the world or updates the position of an existing shuttle.

GenerateWorld ( Netlink n ) : World

Create a world object from a Netlink object.

RemoveOldShuttles ( ) : void

Removes all shuttles older than SHUTTLE_EXPIRATION_TIME

Private Methods

Method Description
AddRoute ( RouteJson route ) : void
AddRoute ( int routeId, string name, List coords ) : void
AddStop ( StopJson stop ) : void
AddStop ( string stopId, Coordinate location, string name, List routes ) : void
CurrentTimeMillis ( ) : long
World ( ) : System

Method Details

AddOrUpdateShuttle() public method

Adds a shuttle to the world or updates the position of an existing shuttle.
public AddOrUpdateShuttle ( int shuttleId, Coordinate location, string name, int bearing, string cardinalPoint, int speed, int route = -1 ) : void
shuttleId int The ID number of the shuttle.
location Coordinate The shuttle's current location.
name string The name of the shuttle.
bearing int The heading of the shuttle in degrees from north.
cardinalPoint string The heading of the shuttle as a cardinal direcation (e.g. Northwest).
speed int The speed of the shuttle in miles per hour.
route int The id of the shuttle route. -1 indicates that the shuttle is not on a route.
return void

GenerateWorld() public static method

Create a world object from a Netlink object.
public static GenerateWorld ( Netlink n ) : World
n Netlink The Netlink class that represents the Netlink JSON.
return World

RemoveOldShuttles() public method

Removes all shuttles older than SHUTTLE_EXPIRATION_TIME
public RemoveOldShuttles ( ) : void
return void