I'm trying to use JWatte's XNA-Path as the base for a game-console class I'm writing. Using this code:
void HandleRequest(string request) { string[] lines = request.Split(new string[] { ";", }, StringSplitOptions.RemoveEmptyEntries); foreach (string line in lines) { int offset = 0; if (dictionary.Count != 0) Path.Eval(line, dictionary); if (Path.Errors.Count != 0) { foreach (string error in Path.Errors) PostMessage(error, "CommandError"); Path.Errors.Clear(); } else PostMessage(line, "Executed"); } }
PropertyDictionary dict = new PropertyDictionary(); dict.Add("Game", this); //The Game Class dict.Add("Console", cons); //The Console class dict.Add("Tri", tri); //A Triangle class cons.dictionary = dict; //cons is the console class
Is there a special way I have to create or use the dictionary to make it work?
Thanks in advance,
Greg
Better late than never
Better late than never response: I don't think there's anything special you need to do. You might want to use the debugger to step into the code that tries to evaluate the global value, and see where it goes wrong, to see what might be the problem.