From 6277fccc77dda80ddfe7bad7a9e0079d2f833557 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 24 Sep 2018 10:24:02 -0500 Subject: [PATCH] mark as passed / failed --- EduNetworkBuilder/ActionClass.cs | 5 +++++ EduNetworkBuilder/NBSettings.cs | 12 ++++++++++++ EduNetworkBuilder/Network.cs | 2 ++ 3 files changed, 19 insertions(+) diff --git a/EduNetworkBuilder/ActionClass.cs b/EduNetworkBuilder/ActionClass.cs index ba652b2..49a1b07 100644 --- a/EduNetworkBuilder/ActionClass.cs +++ b/EduNetworkBuilder/ActionClass.cs @@ -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) diff --git a/EduNetworkBuilder/NBSettings.cs b/EduNetworkBuilder/NBSettings.cs index 51f04d6..babd4bf 100644 --- a/EduNetworkBuilder/NBSettings.cs +++ b/EduNetworkBuilder/NBSettings.cs @@ -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; diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index b708d3e..331d5f3 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -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(); } } }