Probelm with XNA-Path

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");
            }
        }

While the dictionary is created in the game class like that:
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

I already made some minor changes to the Path code only affection the error messages, so that it dose not crash the game when it encounters a error, but shows it in the console.
The problem now is that Path can't find any properties in the PropertyDictionary, and only works if I give it a current object to work with (Path.Eval(expr, offset, current, dictionary)).

Is there a special way I have to create or use the dictionary to make it work?

Thanks in advance,
Greg

jwatte's picture

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.