1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 15:40:29 +01:00

Refactored fields and properties, extracted relevant functions from other classes and consolidated them here

This commit is contained in:
Rich Dunne 2020-08-20 16:27:50 -06:00
parent 893f1eba0e
commit 42acd1c56a

View file

@ -4,17 +4,17 @@ namespace SceneManager
{ {
public class Path public class Path
{ {
public int PathNum; public int PathNum { get; private set; }
public bool PathFinished; public bool PathFinished { get; private set; }
public bool PathDisabled; public bool PathDisabled { get; private set; }
public List<Waypoint> Waypoint = new List<Waypoint>() { }; public List<Waypoint> Waypoints = new List<Waypoint>();
public Path(int pathNum, bool pathFinished, bool pathDisabled, List<Waypoint> waypointData) public Path(int pathNum, bool pathFinished, bool pathDisabled, List<Waypoint> waypoints)
{ {
PathNum = pathNum; PathNum = pathNum;
PathFinished = pathFinished; PathFinished = pathFinished;
PathDisabled = pathDisabled; PathDisabled = pathDisabled;
Waypoint = waypointData; Waypoints = waypoints;
} }
public Path(int pathNum, bool pathFinished) public Path(int pathNum, bool pathFinished)
@ -22,5 +22,50 @@ namespace SceneManager
PathNum = pathNum; PathNum = pathNum;
PathFinished = pathFinished; PathFinished = pathFinished;
} }
public void SetPathNumber(int pathNum)
{
PathNum = pathNum;
}
public void FinishPath()
{
PathFinished = true;
}
public void DisablePath()
{
PathDisabled = true;
LowerWaypointBlipsOpacity();
}
private void LowerWaypointBlipsOpacity()
{
foreach (Waypoint wp in Waypoints)
{
wp.Blip.Alpha = 0.5f;
if (wp.CollectorRadiusBlip)
{
wp.CollectorRadiusBlip.Alpha = 0.25f;
}
}
}
public void EnablePath()
{
PathDisabled = false;
}
private void RestoreWaypointBlipsOpacity()
{
foreach (Waypoint wp in Waypoints)
{
wp.Blip.Alpha = 1.0f;
if (wp.CollectorRadiusBlip)
{
wp.CollectorRadiusBlip.Alpha = 0.5f;
}
}
}
} }
} }