示例#1
0
        public void AddEnum(string className, string enumName, IEnumerable <KeyValuePair <string, int> > values)
        {
            LuaBase parent = this;

            if (className != null)
            {
                parent = objects[className];
            }
            LuaEnum @enum = null;

            if (parent.ContainsObject(enumName))
            {
                @enum = (LuaEnum)parent[enumName];
            }
            else
            {
                @enum = new LuaEnum(enumName);
                parent.AddChild(@enum);
            }
            if (values != null)
            {
                foreach (var value in values)
                {
                    @enum.AddValue(value.Key, value.Value);
                }
            }
        }
示例#2
0
        public void AddMethod(string className, string methodName, IEnumerable <string> parameters)
        {
            LuaBase parent = this;

            if (className != null)
            {
                parent = objects[className];
            }
            if (!parent.ContainsObject(methodName))
            {
                parent.AddChild(new LuaMethod(methodName, parameters));
            }
        }
示例#3
0
        public void AddFunction(string className, string functionName, IEnumerable <string> parameters)
        {
            LuaBase parent = this;

            if (className != null)
            {
                parent = objects[className];
            }
            if (!parent.ContainsObject(functionName))
            {
                parent.AddChild(new LuaFunction(functionName, parameters));
            }
        }