public void AddRecover(RecoverEventArgs e) { List <HPMPWhoEntity> whoList = null; if (e.IsHP) { this.HPRecover += e.Amount; HPRecoverLogList.Add(e.log); whoList = HPWhoList; } else { this.MPRecover += e.Amount; MPRecoverLogList.Add(e.log); whoList = MPWhoList; } HPMPWhoEntity whoEntity = null; HPMPSkillEntity skillEntity = null; e.Who = (String.IsNullOrEmpty(e.Who)) ? null : e.Who; e.Skill = (String.IsNullOrEmpty(e.Skill)) ? null : e.Skill; foreach (HPMPWhoEntity entity in whoList) { if (entity.Who == e.Who) { whoEntity = entity; break; } } if (whoEntity == null) { whoEntity = new HPMPWhoEntity((String.IsNullOrEmpty(e.Who)) ? null : e.Who); whoList.Add(whoEntity); } foreach (HPMPSkillEntity se in whoEntity.SkillList) { if (se.SkillName == e.Skill) { skillEntity = se; break; } } if (skillEntity == null) { skillEntity = new HPMPSkillEntity(); skillEntity.SkillName = e.Skill; whoEntity.SkillList.Add(skillEntity); } skillEntity.TotalRecover += e.Amount; skillEntity.Count++; whoEntity.SkillList[0].TotalRecover += e.Amount; whoEntity.SkillList[0].Count++; }
public HPMPWhoEntity(string who) { this.Who = who; SkillList = new List <HPMPSkillEntity>(); HPMPSkillEntity total = new HPMPSkillEntity(); total.SkillName = "전체"; SkillList.Add(total); }