Add functions to set passed / set failed

This commit is contained in:
Tim Young 2018-09-21 13:09:07 -05:00
parent 864c697f8e
commit 5264bd482d
2 changed files with 26 additions and 0 deletions

View File

@ -130,6 +130,8 @@ namespace EduNetworkBuilder
/// This tells us if it has been stored to the long-term action list.
/// </summary>
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

View File

@ -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