public E_Skill GetCharacterSkillByIdAndNetworkId(short skillId, int netId) { Dictionary <short, E_Skill> learnedSkill = null; if (!m_characterSkillDict.TryGetValue(netId, out learnedSkill)) { return(null); } E_Skill res = null; learnedSkill.TryGetValue(skillId, out res); return(res); }
public E_Skill[] InitCharacter(int netId, int charId) { E_Skill[] res; Dictionary <short, E_Skill> charSkillDict; // 若角色已经加载 if (m_characterSkillDict.TryGetValue(netId, out charSkillDict)) { res = new E_Skill[charSkillDict.Count]; var en = charSkillDict.Values.GetEnumerator(); var i = 0; while (en.MoveNext()) { res[i] = en.Current; i++; } return(res); } var ddoList = m_dds.GetSkillListByCharacterId(charId); res = new E_Skill[ddoList.Count]; charSkillDict = new Dictionary <short, E_Skill> (); for (int i = 0; i < ddoList.Count; i++) { DE_Skill de; DE_SkillData dataDe; if (!m_dem.GetSkillByIdAndLevel(ddoList[i].m_skillId, ddoList[i].m_skillLevel, out de, out dataDe)) { continue; } E_Skill skillObj = m_skillPool.GetInstance(); skillObj.Reset(de, dataDe, ddoList[i]); res[i] = skillObj; charSkillDict.Add(skillObj.m_SkillId, skillObj); } m_characterSkillDict[netId] = charSkillDict; return(res); }
public void CharacterUpdateSkill(int charId, E_Skill skObj) { m_dds.UpdateSkill(skObj.GetDdo(charId)); }