public ActorModule() { this.m_ActorLogicDataDic = new Dictionary <string, ActorLogicData>(); List <ActorData> actorList = ConfigCtrller.Instance.Actor.GetActors(); string actorUIDPrefix = "actor{0}"; string skillUIDPrefix = "skill{0}"; int actorUIDCounter = 1; int skillUIDCounter = 1; foreach (var actorData in actorList) { List <SkillLogicDataBase> skillList = new List <SkillLogicDataBase>(); foreach (var acotrSkillID in actorData.Skills) { ActorSkillData actorSkillData = ConfigCtrller.Instance.Skill.GetActorSkillDataByID(acotrSkillID); List <SkillDataBase> skillDataBaseList = new List <SkillDataBase>(); foreach (var skillID in actorSkillData.SkillIDs) { SkillDataBase skillDataBase = ConfigCtrller.Instance.Skill.GetSkillDataBaseByID(skillID); skillDataBaseList.Add(skillDataBase); } SkillLogicDataBase skillLogicData = null; string skillUID = string.Format(skillUIDPrefix, skillUIDCounter); switch (actorSkillData.SkillType) { case SkillType.Normal: break; case SkillType.First: case SkillType.Active: skillLogicData = new ActiveSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; case SkillType.Passive: skillLogicData = new PassiveSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; case SkillType.Trigger: skillLogicData = new TriggerSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; case SkillType.Weather: skillLogicData = new WeatherSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; default: break; } skillUIDCounter++; if (skillLogicData != null) { skillList.Add(skillLogicData); } } string actorUID = string.Format(actorUIDPrefix, actorUIDCounter++); ActorLogicData actorLogicData = new ActorLogicData(actorUID, actorData, skillList); this.m_ActorLogicDataDic.Add(actorUID, actorLogicData); } this.InitBattleArray(); }
public ActorModule() { this.m_ActorLogicDataDic = new Dictionary<string, ActorLogicData>(); List<ActorData> actorList = ConfigCtrller.Instance.Actor.GetActors(); string actorUIDPrefix= "actor{0}"; string skillUIDPrefix= "skill{0}"; int actorUIDCounter= 1; int skillUIDCounter = 1; foreach (var actorData in actorList) { List<SkillLogicDataBase> skillList = new List<SkillLogicDataBase>(); foreach (var acotrSkillID in actorData.Skills) { ActorSkillData actorSkillData = ConfigCtrller.Instance.Skill.GetActorSkillDataByID(acotrSkillID); List<SkillDataBase> skillDataBaseList = new List<SkillDataBase>(); foreach (var skillID in actorSkillData.SkillIDs) { SkillDataBase skillDataBase = ConfigCtrller.Instance.Skill.GetSkillDataBaseByID(skillID); skillDataBaseList.Add(skillDataBase); } SkillLogicDataBase skillLogicData = null; string skillUID = string.Format(skillUIDPrefix, skillUIDCounter); switch (actorSkillData.SkillType) { case SkillType.Normal: break; case SkillType.First: case SkillType.Active: skillLogicData = new ActiveSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; case SkillType.Passive: skillLogicData = new PassiveSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; case SkillType.Trigger: skillLogicData = new TriggerSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; case SkillType.Weather: skillLogicData = new WeatherSkillLogicData(skillUID, actorSkillData, skillDataBaseList); break; default: break; } skillUIDCounter++; if (skillLogicData != null) { skillList.Add(skillLogicData); } } string actorUID = string.Format(actorUIDPrefix,actorUIDCounter++); ActorLogicData actorLogicData = new ActorLogicData(actorUID, actorData, skillList); this.m_ActorLogicDataDic.Add(actorUID,actorLogicData); } this.InitBattleArray(); }
/// <summary> /// 初始化 /// </summary> /// <param name="data"></param> public void InitEnemy(int id, GridData gridData) { ActorData actorData = ConfigCtrller.Instance.Actor.GetActorDataByID(id); List <SkillLogicDataBase> skillList = new List <SkillLogicDataBase>(); foreach (var acotrSkillID in actorData.Skills) { ActorSkillData actorSkillData = ConfigCtrller.Instance.Skill.GetActorSkillDataByID(acotrSkillID); List <SkillDataBase> skillDataBaseList = new List <SkillDataBase>(); foreach (var skillID in actorSkillData.SkillIDs) { SkillDataBase skillDataBase = ConfigCtrller.Instance.Skill.GetSkillDataBaseByID(skillID); skillDataBaseList.Add(skillDataBase); } SkillLogicDataBase skillLogicData = null; switch (actorSkillData.SkillType) { case SkillType.Normal: break; case SkillType.First: case SkillType.Active: skillLogicData = new ActiveSkillLogicData(actorSkillData, skillDataBaseList); break; case SkillType.Passive: skillLogicData = new PassiveSkillLogicData(actorSkillData, skillDataBaseList); break; case SkillType.Trigger: skillLogicData = new TriggerSkillLogicData(actorSkillData, skillDataBaseList); break; case SkillType.Weather: skillLogicData = new WeatherSkillLogicData(actorSkillData, skillDataBaseList); break; default: break; } if (skillLogicData != null) { skillList.Add(skillLogicData); } } ActorLogicData actorLogicData = new ActorLogicData(actorData, skillList); this.Init(actorLogicData); }
/// <summary> /// 初始化 /// </summary> /// <param name="data"></param> public void InitEnemy(int id, GridData gridData) { ActorData actorData = ConfigCtrller.Instance.Actor.GetActorDataByID(id); List<SkillLogicDataBase> skillList = new List<SkillLogicDataBase>(); foreach (var acotrSkillID in actorData.Skills) { ActorSkillData actorSkillData = ConfigCtrller.Instance.Skill.GetActorSkillDataByID(acotrSkillID); List<SkillDataBase> skillDataBaseList = new List<SkillDataBase>(); foreach (var skillID in actorSkillData.SkillIDs) { SkillDataBase skillDataBase = ConfigCtrller.Instance.Skill.GetSkillDataBaseByID(skillID); skillDataBaseList.Add(skillDataBase); } SkillLogicDataBase skillLogicData = null; switch (actorSkillData.SkillType) { case SkillType.Normal: break; case SkillType.First: case SkillType.Active: skillLogicData = new ActiveSkillLogicData(actorSkillData, skillDataBaseList); break; case SkillType.Passive: skillLogicData = new PassiveSkillLogicData(actorSkillData, skillDataBaseList); break; case SkillType.Trigger: skillLogicData = new TriggerSkillLogicData(actorSkillData, skillDataBaseList); break; case SkillType.Weather: skillLogicData = new WeatherSkillLogicData(actorSkillData, skillDataBaseList); break; default: break; } if (skillLogicData != null) { skillList.Add(skillLogicData); } } ActorLogicData actorLogicData = new ActorLogicData(actorData, skillList); this.Init(actorLogicData); }