public static TargetSelect GetTargetSelect(string name) { if (!TargetSelects.ContainsKey(name)) { return(null); } TargetSelect select = TargetSelects[name]; return(select); }
public static IEnumerable <SkillObj> GetTargets(SkillObj skillObj, TargetSelect select, TargetType tType, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if (select == null || tType == null) { return(null); } var ret = select.GetTargets(skillObj, buffInfo, buffConfig).Where(t => tType.IsTarget(skillObj, t)); return(ret); }
public static IEnumerable<SkillObj> GetTargets(SkillObj skillObj, TargetSelect select, TargetType tType, BuffInfo_New buffInfo, BuffConfig_New buffConfig) { if (select == null || tType == null) { return null; } var ret = select.GetTargets(skillObj, buffInfo, buffConfig).Where(t => tType.IsTarget(skillObj, t)); return ret; }
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); } } }