From 5264bd482d8dc2dba5f35ebeba9025560bf07b35 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Fri, 21 Sep 2018 13:09:07 -0500 Subject: [PATCH] Add functions to set passed / set failed --- EduNetworkBuilder/ActionClass.cs | 12 ++++++++++++ EduNetworkBuilder/NBSettings.cs | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/EduNetworkBuilder/ActionClass.cs b/EduNetworkBuilder/ActionClass.cs index a4fa856..ba652b2 100644 --- a/EduNetworkBuilder/ActionClass.cs +++ b/EduNetworkBuilder/ActionClass.cs @@ -130,6 +130,8 @@ namespace EduNetworkBuilder /// This tells us if it has been stored to the long-term action list. /// public bool HasBeenStored = false; + public bool HasPassed = false; + public bool HasFailed = false; public NetworkAction() { } public NetworkAction(string Name) { @@ -150,6 +152,16 @@ namespace EduNetworkBuilder { Actions.Add(What); } + public void SetPassed() + { + HasPassed = true; + HasFailed = false; + } + public void SetFailed() + { + HasPassed = false; + HasFailed = true; + } } public class ActionClass diff --git a/EduNetworkBuilder/NBSettings.cs b/EduNetworkBuilder/NBSettings.cs index b8afe0b..bbf7553 100644 --- a/EduNetworkBuilder/NBSettings.cs +++ b/EduNetworkBuilder/NBSettings.cs @@ -165,6 +165,8 @@ namespace EduNetworkBuilder foreach (NetworkAction NetAction in UserActions.NetActions) { NetAction.HasBeenStored = true; //All of them start out stored + NetAction.HasFailed = false; + NetAction.HasPassed = false; } UserActions.HasUnsavedChanges = false; //we have just loaded a clean thing. Nothing to save } @@ -177,6 +179,18 @@ namespace EduNetworkBuilder return true; } + public void SetPassed(string networkname) + { + if (UserActions == null) return; + NetworkAction NA = UserActions.FindAction(networkname); + NA.SetPassed(); + } + public void SetFailed(string networkname) + { + if (UserActions == null) return; + NetworkAction NA = UserActions.FindAction(networkname); + NA.SetFailed(); + } public bool CheckIfDone(string PuzzleName) { //we just mark it in the settings class