Track whether action changes have been stored in long-term memory.

This commit is contained in:
Tim Young 2018-05-11 10:43:48 -05:00
parent 98ed29a45e
commit 44b26812ed

View File

@ -30,9 +30,17 @@ namespace EduNetworkBuilder
if (start == null) return;//Do nothing if (start == null) return;//Do nothing
CurrentNetAction = new NetworkAction(start); CurrentNetAction = new NetworkAction(start);
} }
CurrentNetAction.HasBeenStored = false;// We have a change. That change has not been pushed
CurrentNetAction.Add(What); CurrentNetAction.Add(What);
} }
public bool CurrentNeedsStoring
{ get {
if (CurrentNetAction == null) return false;
return (CurrentNetAction.HasBeenStored == false);
}
}
public bool RunAction(int WhichIndex) public bool RunAction(int WhichIndex)
{ {
if (CurrentNetAction == null) return false; if (CurrentNetAction == null) return false;
@ -58,6 +66,7 @@ namespace EduNetworkBuilder
if (NA != null) NetActions.Remove(NA); if (NA != null) NetActions.Remove(NA);
} }
//Add this one //Add this one
CurrentNetAction.HasBeenStored = true; //Note that we have stored it
NetActions.Add(CurrentNetAction); NetActions.Add(CurrentNetAction);
} }
@ -99,6 +108,10 @@ namespace EduNetworkBuilder
{ {
public string NetworkName = ""; public string NetworkName = "";
public List<ActionClass> Actions = new List<ActionClass>(); public List<ActionClass> Actions = new List<ActionClass>();
/// <summary>
/// This tells us if it has been stored to the long-term action list.
/// </summary>
public bool HasBeenStored = false;
public NetworkAction(string Name) public NetworkAction(string Name)
{ {
NetworkName = Name; NetworkName = Name;