Example #1
0
        public static int GetLhsObj(string lhs)
        {
            int result;

            if (Int32.TryParse(lhs, out result))
            {
                return(result);
            }
            else if (lhs.IndexOf(".") != -1)
            {
                Game   g    = Game.GetInstance();
                string left = lhs.Substring(0, lhs.IndexOf("."));

                if (g.IsVariable(left))
                {
                    return(g.GetVarVal(left));
                }
                else
                {
                    return(g.GetObjectId(left));
                }
            }
            else
            {
                Game g = Game.GetInstance();
                return(g.GetObjectId(lhs));
            }
        }
Example #2
0
        public override int Eval()
        {
            Game g = Game.GetInstance();

            return(g.GetVarVal(name));
        }