From 6a6b8b5492fd275bbff3dc9546c342098d6b825f Mon Sep 17 00:00:00 2001 From: Rich Dunne Date: Thu, 20 Aug 2020 19:29:56 -0600 Subject: [PATCH] Refactored fields and properties --- .../Object Classes/CollectedVehicle.cs | 54 +++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/SceneManager/Object Classes/CollectedVehicle.cs b/SceneManager/Object Classes/CollectedVehicle.cs index a1c0970..0dd39a8 100644 --- a/SceneManager/Object Classes/CollectedVehicle.cs +++ b/SceneManager/Object Classes/CollectedVehicle.cs @@ -4,15 +4,15 @@ namespace SceneManager { public class CollectedVehicle { - public Vehicle Vehicle; - public string LicensePlate; - public int Path; - public int TotalWaypoints; - public int CurrentWaypoint; - public bool TasksAssigned; - public bool DismissNow; - public bool StoppedAtWaypoint; - public bool Redirected; + public Vehicle Vehicle { get; private set; } + public string LicensePlate { get; private set; } + public int Path { get; private set; } + public int TotalWaypoints { get; private set; } + public int CurrentWaypoint { get; private set; } + public bool TasksAssigned { get; private set; } + public bool DismissNow { get; private set; } + public bool StoppedAtWaypoint { get; private set; } + public bool Redirected { get; private set; } public CollectedVehicle(Vehicle vehicle, string licensePlate, int path, int totalWaypoints, int currentWaypoint, bool tasksAssigned, bool dismissNow, bool redirected) { @@ -25,5 +25,41 @@ namespace SceneManager DismissNow = dismissNow; Redirected = redirected; } + + public void AssignPropertiesFromDirectedTask(int pathNum, int totalPathWaypoints, int currentWaypoint, bool tasksAssigned, bool dismiss, bool stoppedAtWaypoint, bool redirected) + { + Path = pathNum; + TotalWaypoints = totalPathWaypoints; + CurrentWaypoint = currentWaypoint; + TasksAssigned = tasksAssigned; + DismissNow = dismiss; + StoppedAtWaypoint = stoppedAtWaypoint; + Redirected = redirected; + } + + public void SetCurrentWaypoint(int currentWaypoint) + { + CurrentWaypoint = currentWaypoint; + } + + public void SetTasksAssigned(bool tasksAssigned) + { + TasksAssigned = tasksAssigned; + } + + public void SetDismissNow(bool dismissNow) + { + DismissNow = dismissNow; + } + + public void SetStoppedAtWaypoint(bool stoppedAtWaypoint) + { + StoppedAtWaypoint = stoppedAtWaypoint; + } + + public void SetRedirected(bool redirected) + { + Redirected = redirected; + } } }