From 44b26812edb43e9239d7b8d889fd13bd464a9121 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Fri, 11 May 2018 10:43:48 -0500 Subject: [PATCH] Track whether action changes have been stored in long-term memory. --- EduNetworkBuilder/ActionClass.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/EduNetworkBuilder/ActionClass.cs b/EduNetworkBuilder/ActionClass.cs index 437b8d8..71a1595 100644 --- a/EduNetworkBuilder/ActionClass.cs +++ b/EduNetworkBuilder/ActionClass.cs @@ -30,9 +30,17 @@ namespace EduNetworkBuilder if (start == null) return;//Do nothing CurrentNetAction = new NetworkAction(start); } + CurrentNetAction.HasBeenStored = false;// We have a change. That change has not been pushed CurrentNetAction.Add(What); } + public bool CurrentNeedsStoring + { get { + if (CurrentNetAction == null) return false; + return (CurrentNetAction.HasBeenStored == false); + } + } + public bool RunAction(int WhichIndex) { if (CurrentNetAction == null) return false; @@ -58,6 +66,7 @@ namespace EduNetworkBuilder if (NA != null) NetActions.Remove(NA); } //Add this one + CurrentNetAction.HasBeenStored = true; //Note that we have stored it NetActions.Add(CurrentNetAction); } @@ -99,6 +108,10 @@ namespace EduNetworkBuilder { public string NetworkName = ""; public List Actions = new List(); + /// + /// This tells us if it has been stored to the long-term action list. + /// + public bool HasBeenStored = false; public NetworkAction(string Name) { NetworkName = Name;