public void SetLeaderAvatar(AvatarDetailData avatarDetailData) { this.leaderAvatar = new AvatarDataItem((int)avatarDetailData.get_avatar_id(), (int)avatarDetailData.get_avatar_level(), (int)avatarDetailData.get_avatar_star()); WeaponDetailData data = avatarDetailData.get_weapon(); if ((data != null) && (WeaponMetaDataReader.GetWeaponMetaDataByKey((int)data.get_id()) != null)) { WeaponDataItem item = new WeaponDataItem(0, WeaponMetaDataReader.GetWeaponMetaDataByKey((int)data.get_id())) { level = (int)data.get_level() }; this.leaderAvatar.equipsMap[1] = item; } EquipmentSlot[] slotArray = new EquipmentSlot[] { 2, 3, 4 }; List <StigmataDetailData> list = new List <StigmataDetailData> { avatarDetailData.get_stigmata_1(), avatarDetailData.get_stigmata_2(), avatarDetailData.get_stigmata_3() }; for (int i = 0; i < list.Count; i++) { StigmataDetailData data2 = list[i]; if ((data2 != null) && (StigmataMetaDataReader.GetStigmataMetaDataByKey((int)data2.get_id()) != null)) { StigmataDataItem item2 = new StigmataDataItem(0, StigmataMetaDataReader.GetStigmataMetaDataByKey((int)data2.get_id())) { level = (int)data2.get_level() }; int num2 = !data2.get_pre_affix_idSpecified() ? 0 : ((int)data2.get_pre_affix_id()); int num3 = !data2.get_suf_affix_idSpecified() ? 0 : ((int)data2.get_suf_affix_id()); item2.SetAffixSkill(true, num2, num3); this.leaderAvatar.equipsMap[slotArray[i]] = item2; } } foreach (AvatarSkillDetailData data3 in avatarDetailData.get_skill_list()) { if (this.leaderAvatar.GetAvatarSkillBySkillID((int)data3.get_skill_id()) != null) { AvatarSkillDataItem avatarSkillBySkillID = this.leaderAvatar.GetAvatarSkillBySkillID((int)data3.get_skill_id()); foreach (AvatarSubSkillDetailData data4 in data3.get_sub_skill_list()) { if (avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId((int)data4.get_sub_skill_id()) != null) { avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId((int)data4.get_sub_skill_id()).level = (int)data4.get_level(); } } } } }
public AvatarDataItem Clone() { AvatarDataItem item = new AvatarDataItem(this.avatarID, this.level, this.star) { UnLocked = this.UnLocked, Initialized = this.Initialized, exp = this.exp, fragment = this.fragment }; foreach (EquipmentSlot slot in EQUIP_SLOTS) { StorageDataItemBase base2 = (this.equipsMap[slot] != null) ? this.equipsMap[slot].Clone() : null; item.equipsMap[slot] = base2; } foreach (AvatarSkillDataItem item2 in this.skillDataList) { AvatarSkillDataItem avatarSkillBySkillID = item.GetAvatarSkillBySkillID(item2.skillID); avatarSkillBySkillID.UnLocked = item2.UnLocked; foreach (AvatarSubSkillDataItem item4 in item2.avatarSubSkillList) { avatarSkillBySkillID.GetAvatarSubSkillBySubSkillId(item4.subSkillID).level = item4.level; } } return(item); }