diff --git a/ChessEngineAPI/App/App.cs b/ChessEngineAPI/App/App.cs index ac12693..7e429c8 100644 --- a/ChessEngineAPI/App/App.cs +++ b/ChessEngineAPI/App/App.cs @@ -71,8 +71,15 @@ private static void InitializeMethods() Methods.Add("MAKEMOVE", (value, value2) => MakeMoveRequest(value, value2)); Methods.Add("GETENGINEMOVE", (value, value2) => EngineMoveRequest(value, value2)); Methods.Add("CREATEINSTANCE", (value, value2) => CreateInstanceRequest(value, value2)); + Methods.Add("REMOVEINSTANCE", (value, value2) => RemoveInstanceRequest(value, value2)); } + [Requestable] + private static void RemoveInstanceRequest(string key, string _Input) + { + GlobalVars.PyProcesses[key].GetProcess.Kill(true); + GlobalVars.PyProcesses.Remove(key); + } [Requestable] private static void CreateInstanceRequest(string key, string _Input) {