Пример #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 };
        }
Пример #2
0
        public static string GetTypeNameEntityPointer(Type type)
        {
            var postfix = "";

            if (DllInfos.IsTargetType <IEntity>(type) || type.Name == "Entity")
            {
                postfix = "*";
            }

            return(GetTypeNameWithPostFix(type, postfix));
        }
Пример #3
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);
        }
Пример #4
0
 public static string GetEntitySize()
 {
     return(DllInfos.GetAttribute <EntityCountAttribute>(curType.RawType).count.ToString());
 }
Пример #5
0
 public static int GetEntityCount(Type entityType)
 {
     return(DllInfos.GetAttribute <EntityCountAttribute>(entityType).count);
 }
Пример #6
0
 public static TypeInfo[] PrepareTypeInfosRef(Type[] rawTypes)
 {
     return(DllInfos.GetTypes(BT_REF, (bt, t) => !t.IsGenericType && DllInfos.IsTargetType(bt, t)));
 }
Пример #7
0
 public static TypeInfo[] PrepareTypeInfosEnum(Type[] rawTypes)
 {
     return(DllInfos.GetTypes(BT_ENUM, (bt, t) => t.IsEnum));
 }