ResourceExtractor.Serializers.Lua.LuaElement.LuaElement C# (CSharp) Method

LuaElement() public method

public LuaElement ( dynamic obj ) : System.Collections.Generic
obj dynamic
return System.Collections.Generic
        public LuaElement(dynamic obj)
        {
            Attributes = new List<LuaAttribute>();

            Keys = new HashSet<string>();

            ID = obj.id;

            foreach (var key in FixedKeys.Where(key => obj.ContainsKey(key)))
            {
                Attributes.Add(new LuaAttribute(key, obj[key]));
                Keys.Add(key);
            }

            // TODO: Prettier
            var otherKeys = new List<string>();
            foreach (var pair in obj)
            {
                otherKeys.Add(pair.Key);
            }
            foreach (var key in otherKeys.Where(key => !FixedKeys.Contains(key)).OrderBy(key => key))
            {
                Attributes.Add(new LuaAttribute(key, obj[key]));
                Keys.Add(key);
            }
        }