1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-12 08:00:30 +01:00

Replaced Path's IsFinished bool with State enum

This commit is contained in:
Rich Dunne 2020-08-26 04:38:47 -06:00
parent 1918d5c644
commit fc76ea1f80
2 changed files with 26 additions and 35 deletions

View file

@ -179,27 +179,13 @@ namespace SceneManager
// For each element in paths, determine if the element exists but is not finished yet, or if it doesn't exist, create it. // For each element in paths, determine if the element exists but is not finished yet, or if it doesn't exist, create it.
for (int i = 0; i <= paths.Count; i++) for (int i = 0; i <= paths.Count; i++)
{ {
if (paths.ElementAtOrDefault(i) != null && paths[i].PathFinished == false) if (paths.ElementAtOrDefault(i) != null && paths[i].State == State.Creating)
{ {
//Game.LogTrivial($"pathFinished: {paths[i].PathFinished}"); //Game.LogTrivial($"pathFinished: {paths[i].PathFinished}");
Game.LogTrivial($"Resuming path {paths[i].PathNum}"); Game.LogTrivial($"Resuming path {paths[i].PathNum}");
Game.DisplayNotification($"~o~Scene Manager\n~y~[Creating]~w~ Resuming path {paths[i].PathNum}"); Game.DisplayNotification($"~o~Scene Manager\n~y~[Creating]~w~ Resuming path {paths[i].PathNum}");
break; break;
} }
//else if (paths.ElementAtOrDefault(i) == null)
//{
// Do we only want to do this once the first waypoint is added ?
// PathCreationMenu.AddNewPathToPathsCollection(paths, i);
// if (SettingsMenu.debugGraphics.Checked)
// {
// GameFiber.StartNew(() =>
// {
// DebugGraphics.LoopToDrawDebugGraphics(SettingsMenu.debugGraphics, paths[i]);
// });
// }
// break;
//}
} }
} }

View file

@ -2,18 +2,19 @@
namespace SceneManager namespace SceneManager
{ {
public enum Status public enum State
{ {
IsEnabled, Uninitialized,
IsDisabled Creating,
Finished
} }
public class Path public class Path
{ {
public int PathNum { get; private set; } public int PathNum { get; private set; }
public bool PathFinished { get; private set; } //public bool PathFinished { get; private set; }
public bool IsEnabled { get; private set; } public bool IsEnabled { get; private set; }
public Status Status { get; private set; } public State State { get; set; }
public List<Waypoint> Waypoints = new List<Waypoint>(); public List<Waypoint> Waypoints = new List<Waypoint>();
@ -41,16 +42,10 @@ namespace SceneManager
PathNum = pathNum; PathNum = pathNum;
} }
public void FinishPath() //public void FinishPath()
{ //{
PathFinished = true; // PathFinished = true;
} //}
public void DisablePath()
{
IsEnabled = false;
LowerWaypointBlipsOpacity();
}
private void LowerWaypointBlipsOpacity() private void LowerWaypointBlipsOpacity()
{ {
@ -64,11 +59,6 @@ namespace SceneManager
} }
} }
public void EnablePath()
{
IsEnabled = true;
}
private void RestoreWaypointBlipsOpacity() private void RestoreWaypointBlipsOpacity()
{ {
foreach (Waypoint wp in Waypoints) foreach (Waypoint wp in Waypoints)
@ -80,5 +70,20 @@ namespace SceneManager
} }
} }
} }
public void DisablePath()
{
IsEnabled = false;
LowerWaypointBlipsOpacity();
}
public void EnablePath()
{
IsEnabled = true;
}
} }
} }