예제 #1
0
        public static BuffLogicState GetBuffLogicState(string name)
        {
            if (!BuffLogicStates.ContainsKey(name))
            {
                return(null);
            }
            BuffLogicState state = BuffLogicStates[name];

            return(state);
        }
예제 #2
0
        public static BuffLogicState GetBuffLogicState(BuffInfo_New buffInfo, SkillObj logObj)
        {
            string         stateName = logObj.GetBuffLogicStateName(buffInfo);
            BuffLogicState state     = GetBuffLogicState(stateName);

            if (state == null && logObj != null)
            {
                logObj.LogInfo("BuffLogicState not found stateName[{0}]".F(stateName));
            }
            return(state);
        }
예제 #3
0
        private BattleInitClass()
        {
            var asm = Assembly.GetExecutingAssembly();

            foreach (var b in asm.GetTypes())
            {
                if (b.IsSubclassOf(typeof(SkillLogic)))
                {
                    //自动填充SkillLogics
                    SkillLogic ins = asm.CreateInstance(b.FullName) as SkillLogic;
                    BattleModule.SkillLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(SkillLogicState)))
                {
                    //自动填充SkillLogicStates
                    SkillLogicState ins = asm.CreateInstance(b.FullName) as SkillLogicState;
                    BattleModule.SkillLogicStates.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(TargetSelect)))
                {
                    //自动填充TargetSelect
                    TargetSelect ins = asm.CreateInstance(b.FullName) as TargetSelect;
                    BattleModule.TargetSelects.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(TargetType)))
                {
                    //自动填充TargetType
                    TargetType ins = asm.CreateInstance(b.FullName) as TargetType;
                    BattleModule.TargetTypes.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(BuffLogicState)))
                {
                    //自动填充BuffLogicStates
                    BuffLogicState ins = asm.CreateInstance(b.FullName) as BuffLogicState;
                    BattleModule.BuffLogicStates.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(BuffLogic)))
                {
                    //自动填充BuffLogicStates
                    BuffLogic ins = asm.CreateInstance(b.FullName) as BuffLogic;
                    BattleModule.BuffLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(BuffSuperpositionLogic)))
                {
                    //自动填充BuffSuperpositionLogics
                    BuffSuperpositionLogic ins = asm.CreateInstance(b.FullName) as BuffSuperpositionLogic;
                    BattleModule.BuffSuperpositionLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(SkillBulletMovingLogic)))
                {
                    //自动填充SkillBulletMovingLogic
                    SkillBulletMovingLogic ins = asm.CreateInstance(b.FullName) as SkillBulletMovingLogic;
                    BattleModule.SkillBulletMovingLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(SkillBulletCollisionLogic)))
                {
                    //自动填充SkillBulletCollisionLogic
                    SkillBulletCollisionLogic ins = asm.CreateInstance(b.FullName) as SkillBulletCollisionLogic;
                    BattleModule.SkillBulletCollisionLogics.Add(b.Name, ins);
                }
            }
        }