private static int CompareCombatPowerASC2(UIListItemContainer l, UIListItemContainer r) { NkSoldierInfo nkSoldierInfo = (NkSoldierInfo)l.Data; NkSoldierInfo nkSoldierInfo2 = (NkSoldierInfo)r.Data; return(nkSoldierInfo.GetCombatPower().CompareTo((long)nkSoldierInfo2.GetFightPower())); }
public long CalcTotal_CombatPower() { long num = 0L; for (int i = 0; i < 6; i++) { NkSoldierInfo nkSoldierInfo = this.m_kSolInfo[i]; if (nkSoldierInfo.IsValid()) { if (nkSoldierInfo.GetSolPosType() == 1) { num += nkSoldierInfo.GetCombatPower(); } } } return(num); }
private int CompareCombatPower(NkSoldierInfo a, NkSoldierInfo b) { return(b.GetCombatPower().CompareTo(a.GetCombatPower())); }
public virtual void SetData(NkSoldierInfo kBase, List <long> kSubList, SOLCOMPOSE_TYPE _Type = SOLCOMPOSE_TYPE.COMPOSE) { if (SolComposeMainDlg.Instance == null) { base.CloseNow(); return; } string text = string.Empty; string text2 = string.Empty; int kind = 0; this.mBaseSolInfo = kBase; this.mSubSolList = kSubList; this.m_SolType = _Type; NkSoldierInfo nkSoldierInfo = null; if (this.mSubSolList != null || this.mSubSolList.Count != 0) { foreach (long current in this.mSubSolList) { NkSoldierInfo soldierInfo = SolComposeMainDlg.GetSoldierInfo(current); if (nkSoldierInfo == null) { nkSoldierInfo = soldierInfo; } else if (nkSoldierInfo.GetCombatPower() < soldierInfo.GetCombatPower()) { nkSoldierInfo = soldierInfo; } } if (nkSoldierInfo != null) { kind = nkSoldierInfo.GetCharKind(); text = nkSoldierInfo.GetName(); text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1031"); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[] { text2, "count", nkSoldierInfo.GetLevel() }); } int num = this.mSubSolList.Count - 1; string text3 = string.Empty; text3 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2034"); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text3, new object[] { text3, "count", num }); this.lbName.SetText(text); this.lbLevel.SetText(text2); this.dtSoldier.SetTexture(eCharImageType.SMALL, kind, (int)nkSoldierInfo.GetGrade(), string.Empty); this.lbSubNum.SetText(text3); this.lbSubNum.Visible = (0 < num); this.lbGold.SetText(string.Format("{0:###,###,###,##0}", SolComposeMainDlg.Instance.COST)); SOLCOMPOSE_TYPE solType = this.m_SolType; if (solType != SOLCOMPOSE_TYPE.COMPOSE) { if (solType == SOLCOMPOSE_TYPE.SELL) { this.lbTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("57")); this.lbExplain.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("58")); this.lbMoneyName.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("34")); this.btnOk.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("35")); } } else { this.lbTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2033")); this.lbExplain.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1717")); this.lbMoneyName.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1728")); this.btnOk.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1729")); } return; } this.Close(); }