Beispiel #1
0
 static void ProcessEvents(LuaTable t)
 {
     for (int ti = 0; ti < t.Capacity; ti++)
     {
         var ev = (LuaTable)t[ti];
         ev[1] = ThnEnum.Check <EventTypes>(ev[1]);
         if (ev.Capacity >= 4)
         {
             var props = (LuaTable)ev[3];
             //TODO: Property flags
         }
     }
 }
Beispiel #2
0
        static void ProcessEntities(LuaTable t)
        {
            //Make sure flags aren't integers
            object o;

            for (int ti = 0; ti < t.Capacity; ti++)
            {
                var ent = (LuaTable)t[ti];
                ent["type"] = ThnEnum.Check <EntityTypes>(ent["type"]);
                if (ent.TryGetValue("lightprops", out o))
                {
                    var lp = (LuaTable)o;
                    if (lp.ContainsKey("type"))
                    {
                        lp["type"] = ThnEnum.Check <LightTypes>(lp["type"]);
                    }
                }
                if (ent.ContainsKey("flags"))
                {
                    ent["flags"] = ConvertFlags((EntityTypes)ent["type"], ent);
                }
            }
        }