Esempio n. 1
0
        public static void DoAfterLoadDll()
        {
            TotalEntitySize = DllInfos.GetTypes <Lockstep.ECS.ECDefine.IEntity>()
                              .Select(t => DllInfos.GetAttribute <EntityCountAttribute>(t).count).Sum();
            var txt         = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Facade.ConfigInfo.MacroDefinePath));
            var macroDefine = JsonMapper.ToObject <Dictionary <string, string> >(txt);

            Config.MacroDefine     = macroDefine;
            Facade.MacroExpend     = Config.MacroExpend;
            Facade.FuncGetTypeName = new Func <Type, string>[] { GetTypeName, GetTypeNameEntityPointer };
        }
Esempio n. 2
0
        public static IEnumerable GetEntityArray(string param)
        {
            var clsName = Facade.ForceGetEnvToken(Define.PC_CLS_NAME);
            var type    = DllInfos.GetType(clsName);
            var size    = DllInfos.GetAttribute <EntityCountAttribute>(type).count;
            var ary     = new int[size];

            for (int i = 0; i < size; i++)
            {
                ary[i] = i;
            }

            return(ary);
        }
Esempio n. 3
0
 public static string GetEntitySize()
 {
     return(DllInfos.GetAttribute <EntityCountAttribute>(curType.RawType).count.ToString());
 }
Esempio n. 4
0
 public static int GetEntityCount(Type entityType)
 {
     return(DllInfos.GetAttribute <EntityCountAttribute>(entityType).count);
 }