public static bool GetItemModeInfo(string code, out Item_Mode_Str newMode) { foreach (var mode in m_ItemModeList) { if (CFormat.ToSimplified(mode.code) == code) { newMode = mode; return(true); } } newMode = new Item_Mode_Str(); return(false); }
public List <Player_Str> GetPlayersByDrop(string drop) { List <Player_Str> list = new List <Player_Str>(); foreach (var item in m_PlayerList) { if (CFormat.ToSimplified(item.drop) == drop) { list.Add(item); } } return(list); }
public string GetPalyerName(string id) { string name = ""; foreach (var player in m_PlayerNameList) { if (CFormat.ToSimplified(CFormat.PureString(id)) == CFormat.ToSimplified(CFormat.PureString(player.id))) { return(player.name); } } return(name); }
public string NameSimpToTrad(string name) { string ret = ""; foreach (var item in m_PlayerDefList) { if (CFormat.ToSimplified(CFormat.PureString(name)) == CFormat.ToSimplified(CFormat.PureString(item.name))) { return(item.name); } } return(ret); }
public string GetIdByCode(string code) { string id = ""; foreach (var player in m_PlayerDefList) { if (CFormat.ToSimplified(CFormat.PureString(code)) == CFormat.ToSimplified(CFormat.PureString("role_" + player.name))) { return(player.id); } } return(id); }
//role_XX ID 此处把 role_XX称作id public bool GetAttrById(string id, out Player_Str player) { foreach (var item in m_PlayerList) { if (CFormat.ToSimplified(item.code) == id) { player = item; return(true); } } player = new Player_Str(); player.more = new List <string>(); return(false); }
public static bool ModeSendNext(string code) { Int32 _code = Int32.Parse(code); Int32 codeType = _code / 100; //当前类型是否最后 int max_code = 0; if (codeType == 1) { max_code = max_code1; } else if (codeType == 2) { max_code = max_code2; } else if (codeType == 3) { max_code = max_code3; } else if (codeType == 4) { max_code = max_code4; } else { return(false); } if (_code >= max_code) { return(false); } // Item_Mode_Str tmp; for (int i = 0; i < m_ItemModeList.Count; i++) { if (CFormat.ToSimplified(m_ItemModeList[i].code) == code) { tmp = m_ItemModeList[i + 1]; m_ItemModeList[i + 1] = m_ItemModeList[i]; m_ItemModeList[i] = tmp; ReSort(); return(true); } } return(false); }
public static bool GetDropAttrById(string id, out Drop_Str drop) { foreach (var item in m_DropList) { if (CFormat.ToSimplified(item.id) == id) { drop = item; return(true); } } drop = new Drop_Str(); drop.list = new List <Drop_Single_Str>(); drop.id = id; return(false); }
public static string GetNameById(string id) { string name = ""; foreach (var item in m_ShopDefList) { if (CFormat.ToSimplified(item.id) == id) { name = item.name; break; } } return(name); }
public bool DelListMap(string code, Map_Str map) { foreach (var item in m_ArmyList) { if (CFormat.ToSimplified(item.code) == code) { if (item.map.Contains(map)) { item.map.Remove(map); return(true); } } } return(false); }
public bool DelListPlayer(string code, string player) { foreach (var item in m_ArmyList) { if (CFormat.ToSimplified(item.code) == code) { if (item.list.Contains(player)) { item.list.Remove(player); return(true); } } } return(false); }
public bool GetAttrByCode(string code, out Army_Str army) { foreach (var item in m_ArmyList) { if (CFormat.ToSimplified(item.code) == code) { army = item; return(true); } } army = new Army_Str(); army.list = new List <string>(); army.map = new List <Map_Str>(); army.code = code; return(false); }
public static bool DelSingleDrop(string id, string name, string num) { for (int i = 0; i < m_DropList.Count; i++) { if (CFormat.ToSimplified(m_DropList[i].id) == id) { Drop_Single_Str single = new Drop_Single_Str(); single.name = name; single.num = num; m_DropList[i].list.Remove(single); return(true); } } return(false); }
public bool MdfyBaseInfoByName(string name, string delay, string range, string disappear) { for (int i = 0; i < m_ArmyList.Count; i++) { if (CFormat.ToSimplified(m_ArmyList[i].name) == name) { Army_Str newStr = new Army_Str(); newStr.code = m_ArmyList[i].code; newStr.name = m_ArmyList[i].name; newStr.reborn_delay = delay; newStr.reborn_range = range; newStr.disappear_time = disappear; newStr.list = m_ArmyList[i].list; newStr.map = m_ArmyList[i].map; m_ArmyList[i] = newStr; } } return(true); }
public static bool GetAttrByName(string shopName, int level, out ShopData_Str shopData) { List <ShopData_Str> shopDataList = new List <ShopData_Str>(); if (level >= 0 && level < 4) { shopDataList = m_ShopDataList[level]; } else { shopData = new ShopData_Str(); shopData.list = new List <string>(); return(false); } string shopNameId = GetShopNameId(shopName); if (shopNameId == "") { shopData = new ShopData_Str(); shopData.list = new List <string>(); return(false); } foreach (var item in shopDataList) { if (CFormat.ToSimplified(item.ShopName) == shopNameId) { shopData = item; return(true); } } shopData = new ShopData_Str(); shopData.list = new List <string>(); return(false); }
public static bool MdfyDropNum(string id, string name, string oldNum, string newNum) { for (int i = 0; i < m_DropList.Count; i++) { if (CFormat.ToSimplified(m_DropList[i].id) == id) { for (int j = 0; j < m_DropList[i].list.Count; j++) { if (String.Compare(m_DropList[i].list[j].name, name, true) == 0 && m_DropList[i].list[j].num == oldNum) { Drop_Single_Str single = new Drop_Single_Str(); single.name = name; single.num = newNum; m_DropList[i].list[j] = single; return(true); } } } } return(false); }