public static MINE_DATA GetMineDataFromGrade(byte grade) { foreach (MINE_DATA current in BASE_MINE_DATA.m_listMineData) { if (BASE_MINE_DATA.ParseGradeFromString(current.MINE_GRADE) == grade) { return(current); } } return(null); }
public override bool ParseDataFromNDT(TsDataReader dr) { foreach (TsDataReader.Row data in dr) { MINE_DATA mINE_DATA = new MINE_DATA(); mINE_DATA.SetData(data); mINE_DATA.nMine_Grade = BASE_MINE_DATA.ParseGradeFromString(mINE_DATA.MINE_GRADE); BASE_MINE_DATA.m_listMineData.Add(mINE_DATA); } return(true); }
public override bool ParseDataFromNDT(TsDataReader dr) { foreach (TsDataReader.Row data in dr) { MINE_CREATE_DATA mINE_CREATE_DATA = new MINE_CREATE_DATA(); mINE_CREATE_DATA.SetData(data); mINE_CREATE_DATA.nMine_Grade = BASE_MINE_DATA.ParseGradeFromString(mINE_CREATE_DATA.MINE_GRADE); if (BASE_MINE_CREATE_DATA.m_dicMineCreateData.ContainsKey(mINE_CREATE_DATA.MINE_ID)) { return(false); } BASE_MINE_CREATE_DATA.m_dicMineCreateData.Add(mINE_CREATE_DATA.MINE_ID, mINE_CREATE_DATA); } return(true); }
public void OnClickMilitaryBatch(IUIObject obj) { string text = string.Empty; string message = string.Empty; MINE_GUILD_CURRENTSTATUS_INFO mINE_GUILD_CURRENTSTATUS_INFO = obj.Data as MINE_GUILD_CURRENTSTATUS_INFO; if (mINE_GUILD_CURRENTSTATUS_INFO != null) { if (mINE_GUILD_CURRENTSTATUS_INFO.i64MineID <= 0L) { return; } if (0L >= NrTSingleton <NewGuildManager> .Instance.GetGuildID()) { return; } NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo; NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(kMyCharInfo.m_PersonID); if (memberInfoFromPersonID == null) { return; } if (memberInfoFromPersonID.GetRank() <= NewGuildDefine.eNEWGUILD_MEMBER_RANK.eNEWGUILD_MEMBER_RANK_INITIATE) { message = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("532"); Main_UI_SystemMessage.ADDMessage(message, SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE); return; } MINE_CREATE_DATA mineCreateDataFromID = BASE_MINE_CREATE_DATA.GetMineCreateDataFromID(mINE_GUILD_CURRENTSTATUS_INFO.i16MineDataID); if (mineCreateDataFromID == null) { return; } MINE_DATA mineDataFromGrade = BASE_MINE_DATA.GetMineDataFromGrade(BASE_MINE_DATA.ParseGradeFromString(mineCreateDataFromID.MINE_GRADE)); if (kMyCharInfo.GetLevel() < (int)mineDataFromGrade.POSSIBLELEVEL) { text = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("408"); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref message, new object[] { text, "count", mineDataFromGrade.POSSIBLELEVEL }); Main_UI_SystemMessage.ADDMessage(message, SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE); return; } byte nMode = 0; long nGuildID = 0L; if (mINE_GUILD_CURRENTSTATUS_INFO.i64DefenceGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID()) { nMode = 2; nGuildID = mINE_GUILD_CURRENTSTATUS_INFO.i64DefenceGuildID; } else if (mINE_GUILD_CURRENTSTATUS_INFO.i64AttackGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID() || mINE_GUILD_CURRENTSTATUS_INFO.i64DefenceGuildID > 0L) { nMode = 4; nGuildID = NrTSingleton <NewGuildManager> .Instance.GetGuildID(); } GS_MINE_SEARCH_REQ gS_MINE_SEARCH_REQ = new GS_MINE_SEARCH_REQ(); gS_MINE_SEARCH_REQ.bSearchMineGrade = mineCreateDataFromID.nMine_Grade; gS_MINE_SEARCH_REQ.m_nMineID = mINE_GUILD_CURRENTSTATUS_INFO.i64MineID; gS_MINE_SEARCH_REQ.m_nGuildID = nGuildID; gS_MINE_SEARCH_REQ.m_nMode = nMode; SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_MINE_SEARCH_REQ, gS_MINE_SEARCH_REQ); } }
public void SetList() { this.m_lbCurrentStatus.Clear(); this.m_InfoSettingTime = Time.realtimeSinceStartup; string text = string.Empty; int num = 0; foreach (MINE_GUILD_CURRENTSTATUS_INFO current in this.m_listMineGuild_CurrentStatus) { NewListItem newListItem = new NewListItem(this.m_lbCurrentStatus.ColumnNum, true, string.Empty); MINE_CREATE_DATA mineCreateDataFromID = BASE_MINE_CREATE_DATA.GetMineCreateDataFromID(current.i16MineDataID); if (mineCreateDataFromID != null) { newListItem.SetListItemData(13, BASE_MINE_DATA.GetMineName(mineCreateDataFromID.GetGrade(), current.i16MineDataID), null, null, null); MINE_DATA mineDataFromGrade = BASE_MINE_DATA.GetMineDataFromGrade(BASE_MINE_DATA.ParseGradeFromString(mineCreateDataFromID.MINE_GRADE)); if (mineDataFromGrade != null) { UIBaseInfoLoader uIBaseInfoLoader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary(mineDataFromGrade.MINE_ICON_NAME); if (uIBaseInfoLoader != null) { newListItem.SetListItemData(6, uIBaseInfoLoader, current, new EZValueChangedDelegate(this.OnClickDefenceMilitaryInfo), null); } } int num2 = 9; string text2 = string.Empty; if (current.i64DefenceGuildID > 0L) { text2 = TKString.NEWString(current.szDefenceGuildName); if (current.bIsGuildWarDefenceGuild) { text2 = string.Format("{0}{1}", NrTSingleton <CTextParser> .Instance.GetTextColor("1401"), text2); } num2 = (int)current.byDefenceMilitaryCount; } else { text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1325"); } if (100 <= NrTSingleton <NkCharManager> .Instance.m_kCharAccountInfo.m_nMasterLevel) { text2 = text2 + " " + current.i64MineID.ToString(); } newListItem.SetListItemData(2, text2, null, null, null); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1629"), "count", num2, "count2", 9 }); newListItem.SetListItemData(10, text, null, null, null); newListItem.SetListItemData(12, string.Empty, null, null, null); if (current.byCurrentStatusType == 1 || current.byCurrentStatusType == 0) { if (current.i64AttackGuildID > 0L) { text = TKString.NEWString(current.szAttackGuildName); if (current.bIsGuildWarAttackGuild) { text = string.Format("{0}{1}", NrTSingleton <CTextParser> .Instance.GetTextColor("1401"), text); } newListItem.SetListItemData(1, text, null, null, null); newListItem.SetListItemData(5, string.Empty, current, new EZValueChangedDelegate(this.OnClickAttackMilitaryInfo), null); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1629"), "count", current.byAttackMilitaryCount, "count2", 9 }); newListItem.SetListItemData(9, text, null, null, null); newListItem.SetListItemData(11, string.Empty, null, null, null); } else { newListItem.SetListItemData(1, string.Empty, null, null, null); newListItem.SetListItemData(9, string.Empty, null, null, null); newListItem.SetListItemData(11, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1632"), null, null, null); } text = this.GetTextFromState(current); if (current.byMilitaryState == 2 || current.byMilitaryState == 3 || current.byMilitaryState == 6 || current.byMilitaryState == 7) { newListItem.SetListItemData(0, false); newListItem.SetListItemData(3, string.Empty, null, null, null); newListItem.SetListItemData(4, text, null, null, null); } else { if (current.byJoinMilitary == 0) { bool flag = true; if (current.i64AttackGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID()) { flag = (current.byAttackMilitaryCount < 9); } else if (current.i64DefenceGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID()) { flag = (current.byDefenceMilitaryCount < 9); } newListItem.SetListItemData(0, flag); if (flag) { UIBaseInfoLoader loader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_B_NewTileBtnBlue"); newListItem.SetListItemData(0, loader, current, new EZValueChangedDelegate(this.OnClickMilitaryBatch), null); newListItem.SetListItemData2(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1323")); } } else if (current.byJoinMilitary == 1) { newListItem.SetListItemData(0, true); UIBaseInfoLoader loader2 = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_B_BattleControl"); newListItem.SetListItemData(0, loader2, current, new EZValueChangedDelegate(this.OnClickMilitaryReturn), null); newListItem.SetListItemData2(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1615")); } newListItem.SetListItemData(3, text, null, null, null); newListItem.SetListItemData(4, string.Empty, null, null, null); } } else if (current.byCurrentStatusType == 2) { NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1); newListItem.SetListItemData(1, @char.GetCharName(), null, null, null); text = this.GetTextFromState(current); newListItem.SetListItemData(3, string.Empty, null, null, null); newListItem.SetListItemData(4, text, null, null, null); } newListItem.Data = current; this.m_lbCurrentStatus.Add(newListItem); num++; } } NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[] { NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1633"), "count1", this.m_Page, "count2", this.m_MaxPage }); this.m_bxPage.SetText(text); this.SetListAttackGuildMark(); this.m_lbCurrentStatus.RepositionItems(); }