mark as passed / failed

This commit is contained in:
Tim Young 2018-09-24 10:24:02 -05:00
parent e61f13c2c1
commit 6277fccc77
3 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,11 @@ namespace EduNetworkBuilder
CurrentNetAction = new NetworkAction(starting);
}
public NetworkAction GetCurrentNetAction()
{
return CurrentNetAction;
}
public void Add(ActionClass What)
{
if(CurrentNetAction == null || CurrentNetAction.HasBeenStored == true)

View File

@ -59,6 +59,18 @@ namespace EduNetworkBuilder
{
UserActions.Add(What);
}
public void RegisterReplayPassed()
{
if (UserActions == null) return;
NetworkAction NA = UserActions.GetCurrentNetAction();
if (NA != null) NA.SetPassed();
}
public void RegisterReplayFailed()
{
if (UserActions == null) return;
NetworkAction NA = UserActions.GetCurrentNetAction();
if (NA != null) NA.SetFailed();
}
public ActionCollection GetUserActionCollection()
{
return UserActions;

View File

@ -1688,7 +1688,9 @@ namespace EduNetworkBuilder
//replay finished
ReplayInProgress = false;
//If we have succeeded, we need to mark it as passed
if (PuzzleIsSolved) Settings.RegisterReplayPassed();
//If we have failed to complete, we need to mark it as failed
else Settings.RegisterReplayFailed();
}
}
}