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