public NkSoldierInfo AddSolInfo(SOLDIER_INFO solInfo, SOLDIER_BATTLESKILL_INFO pkBattleSkill, bool bReadyEquipItem) { NkSoldierInfo nkSoldierInfo = new NkSoldierInfo(); nkSoldierInfo.Set(solInfo); if (pkBattleSkill != null) { nkSoldierInfo.SetBattleSkillInfo(pkBattleSkill); } if (this.ReadySolList.ContainsKey(solInfo.SolID)) { NkSoldierInfo nkSoldierInfo2; if (this.ReadySolList.TryGetValue(solInfo.SolID, out nkSoldierInfo2)) { NrEquipItemInfo equipItemInfo = nkSoldierInfo.GetEquipItemInfo(); if (equipItemInfo != null) { equipItemInfo.Set(nkSoldierInfo2.GetEquipItemInfo()); } } this.ReadySolList.Remove(nkSoldierInfo.GetSolID()); bReadyEquipItem = true; } nkSoldierInfo.SetReceivedEquipItem(bReadyEquipItem); nkSoldierInfo.UpdateSoldierStatInfo(); this.ReadySolList.Add(nkSoldierInfo.GetSolID(), nkSoldierInfo); return(nkSoldierInfo); }
public NkSoldierInfo AddSolInfo(SOLDIER_INFO solInfo, SOLDIER_BATTLESKILL_INFO pkBattleSkill, bool bReadyEquipItem) { NkSoldierInfo nkSoldierInfo = new NkSoldierInfo(); nkSoldierInfo.Set(solInfo); if (pkBattleSkill != null) { nkSoldierInfo.SetBattleSkillInfo(pkBattleSkill); } if (this.IsSameSolExist(solInfo.SolID)) { NkSoldierInfo soldierInfo = this.GetSoldierInfo(solInfo.SolID); if (soldierInfo != null) { NrEquipItemInfo equipItemInfo = nkSoldierInfo.GetEquipItemInfo(); if (equipItemInfo != null) { equipItemInfo.Set(soldierInfo.GetEquipItemInfo()); } } this.RemoveSol(nkSoldierInfo.GetSolID()); bReadyEquipItem = true; } nkSoldierInfo.SetReceivedEquipItem(bReadyEquipItem); nkSoldierInfo.UpdateSoldierStatInfo(); this.m_SolWarehouseList.Add(nkSoldierInfo); return(nkSoldierInfo); }
public void SetSoldierEquipItem(long SolID, NrEquipItemInfo kEquipInfo) { if (this.m_SolList != null) { NkSoldierInfo soldierInfoBySolID = this.m_SolList.GetSoldierInfoBySolID(SolID); if (soldierInfoBySolID != null) { NrEquipItemInfo equipItemInfo = soldierInfoBySolID.GetEquipItemInfo(); equipItemInfo.Set(kEquipInfo); soldierInfoBySolID.UpdateSoldierStatInfo(); this.UpdateSoldieInfo(this.m_SelectIndex); } } else { Debug.LogError("m_SolList null "); } }