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
1 changed files with 13 additions and 0 deletions

View File

@ -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<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)
{
NetworkName = Name;