I am trying to make something like a command line for a game that I am developing using C#. I would like to have something like:
string code;
code = Console.ReadLine();
Something.RunCode(code);
Where I can input a C# code snippet that interacts with things happening to the current thread of execution in my program (for example if I'm stuck in an infinite loop in the main program I can pull up the command line in a separate thread and type in "break;" or "MainThread.Abort();" and I can get out). I want to be able to use C# command line to interact with my program while it it running. I don't know if this is even possible, but I think it will really help me with debugging and such (like use the command line to make a part of my program throw an error and see how it handles it, without having to stop the program, add the error into the source code, and re-build). Thank you in advance.