-
Notifications
You must be signed in to change notification settings - Fork 3
WaypointComponent
This class is initialised by AircraftController, and only one instance exists at a time. This class is responsible for handling the storage and creation of waypoints, both hardcoded and by the user whilst playing the game. References to it are passed to FlightPlanComponent and any other functions that require access to Waypoint data.
It contains four private arrays:
-
ArrayList<Waypoint> permanentList: The list of hardcoded permanent waypoints. This is populated upon class initialisation. -
ArrayList<Waypoint> userListThe list of user created waypoints. Elements can be added and removed from this list by the user while the game is running. -
ArrayList<Entrypoint> entryListThe list of hardcoded permanent entry waypoints. This is populated upon class initialisation. -
ArrayList<Exitpoint> exitListThe list of hardcoded permanent exit waypoints. This is populated upon class initialisation.
Addition of waypoints to permanentList or userList: createWaypoint().
Takes three arguments: the first two concern the horizontal location of the waypoint. The third is a boolean which indicates whether it is a permanent waypoint generated within the class when initialised (adding a Waypoint to permanentList), or one that has been created by the user while the game is running userList.
Removal of Waypoints from userList: createWaypoint().
If a user waypoint is right clicked by the user, it will be removed from userList.
Addition of Waypoints to entryList or exitList: createEntrypoint(), createExitpoint().
Helper methods, called by initialisation to populate their respective lists with waypoints.