Esempio n. 1
0
        public void RawSetValue(string name, LuaValue value)
        {
            LuaValue key = this.GetKey(name);

            if (key == LuaNil.Nil)
            {
                key = new LuaString(name);
            }

            if (this.table == null)
            {
                this.table = new Dictionary <LuaValue, LuaValue>();
            }

            this.table[key] = value;
        }
Esempio n. 2
0
        public LuaValue GetKey(string key)
        {
            if (this.table == null)
            {
                return(LuaNil.Nil);
            }

            foreach (LuaValue value in this.table.Keys)
            {
                LuaString str = value as LuaString;

                if (str != null && string.Equals(str.Text, key, StringComparison.Ordinal))
                {
                    return(value);
                }
            }

            return(LuaNil.Nil);
        }
Esempio n. 3
0
 public override LuaValue Evaluate(LuaValue baseValue, LuaTable enviroment)
 {
     LuaValue key = new LuaString(this.Name);
     return LuaValue.GetKeyValue(baseValue, key);
 }
Esempio n. 4
0
        public void RawSetValue(string name, LuaValue value)
        {
            LuaValue key = this.GetKey(name);

            if (key == LuaNil.Nil)
            {
                key = new LuaString(name);
            }

            if (this.table == null)
            {
                this.table = new Dictionary<LuaValue, LuaValue>();
            }

            this.table[key] = value;
        }