コード例 #1
0
        public Type[] LoadTypesWithAttribute <T>(string assemblyName)
            where T : Attribute
        {
            Type[] types = LoadTypes(assemblyName);
            types = types.Where((clazz) => attributeUtility.HasAttribute <T>(clazz)).ToArray();

            return(types);
        }
コード例 #2
0
        private void Load()
        {
            Type[] battleTypes =
                reflectionUtility.LoadTypesWithAttribute <BattleAttribute>("SamuraiDojo")
                .Where(type => !attributeUtility.HasAttribute <WrittenByAttribute>(type))
                .OrderByDescending(type => attributeUtility.GetAttribute <BattleAttribute>(type).Deadline).ToArray();

            for (int i = 0; i < battleTypes.Length; i++)
            {
                IBattleAttribute battleAttribute = attributeUtility.GetAttribute <BattleAttribute>(battleTypes[i]);
                battleAttribute.Type = battleTypes[i];
                All.Add(battleAttribute);
            }
        }