public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 16) { Debug.Log("FaBaoAttribute.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "LvID") { Debug.Log("FaBaoAttribute.csv中字段[LvID]位置不对应"); return(false); } if (vecLine[1] != "Num") { Debug.Log("FaBaoAttribute.csv中字段[Num]位置不对应"); return(false); } if (vecLine[2] != "Nor") { Debug.Log("FaBaoAttribute.csv中字段[Nor]位置不对应"); return(false); } if (vecLine[3] != "Probability1") { Debug.Log("FaBaoAttribute.csv中字段[Probability1]位置不对应"); return(false); } if (vecLine[4] != "Small") { Debug.Log("FaBaoAttribute.csv中字段[Small]位置不对应"); return(false); } if (vecLine[5] != "Probability2") { Debug.Log("FaBaoAttribute.csv中字段[Probability2]位置不对应"); return(false); } if (vecLine[6] != "Big") { Debug.Log("FaBaoAttribute.csv中字段[Big]位置不对应"); return(false); } if (vecLine[7] != "Probability3") { Debug.Log("FaBaoAttribute.csv中字段[Probability3]位置不对应"); return(false); } if (vecLine[8] != "Supper") { Debug.Log("FaBaoAttribute.csv中字段[Supper]位置不对应"); return(false); } if (vecLine[9] != "Probability4") { Debug.Log("FaBaoAttribute.csv中字段[Probability4]位置不对应"); return(false); } if (vecLine[10] != "Exp") { Debug.Log("FaBaoAttribute.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[11] != "HP") { Debug.Log("FaBaoAttribute.csv中字段[HP]位置不对应"); return(false); } if (vecLine[12] != "Pattack") { Debug.Log("FaBaoAttribute.csv中字段[Pattack]位置不对应"); return(false); } if (vecLine[13] != "Mattack") { Debug.Log("FaBaoAttribute.csv中字段[Mattack]位置不对应"); return(false); } if (vecLine[14] != "PDefense") { Debug.Log("FaBaoAttribute.csv中字段[PDefense]位置不对应"); return(false); } if (vecLine[15] != "MDefense") { Debug.Log("FaBaoAttribute.csv中字段[MDefense]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)16) { return(false); } FaBaoAttributeElement member = new FaBaoAttributeElement(); member.LvID = Convert.ToInt32(vecLine[0]); member.Num = Convert.ToInt32(vecLine[1]); member.Nor = Convert.ToInt32(vecLine[2]); member.Probability1 = Convert.ToInt32(vecLine[3]); member.Small = Convert.ToInt32(vecLine[4]); member.Probability2 = Convert.ToInt32(vecLine[5]); member.Big = Convert.ToInt32(vecLine[6]); member.Probability3 = Convert.ToInt32(vecLine[7]); member.Supper = Convert.ToInt32(vecLine[8]); member.Probability4 = Convert.ToInt32(vecLine[9]); member.Exp = Convert.ToInt32(vecLine[10]); member.HP = Convert.ToInt32(vecLine[11]); member.Pattack = Convert.ToInt32(vecLine[12]); member.Mattack = Convert.ToInt32(vecLine[13]); member.PDefense = Convert.ToInt32(vecLine[14]); member.MDefense = Convert.ToInt32(vecLine[15]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.LvID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 49) { Ex.Logger.Log("Role.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "id") { Ex.Logger.Log("Role.csv中字段[id]位置不对应"); return(false); } if (vecLine[1] != "comment") { Ex.Logger.Log("Role.csv中字段[comment]位置不对应"); return(false); } if (vecLine[2] != "race") { Ex.Logger.Log("Role.csv中字段[race]位置不对应"); return(false); } if (vecLine[3] != "occupation") { Ex.Logger.Log("Role.csv中字段[occupation]位置不对应"); return(false); } if (vecLine[4] != "gender") { Ex.Logger.Log("Role.csv中字段[gender]位置不对应"); return(false); } if (vecLine[5] != "race_icon") { Ex.Logger.Log("Role.csv中字段[race_icon]位置不对应"); return(false); } if (vecLine[6] != "race_name") { Ex.Logger.Log("Role.csv中字段[race_name]位置不对应"); return(false); } if (vecLine[7] != "race_desc") { Ex.Logger.Log("Role.csv中字段[race_desc]位置不对应"); return(false); } if (vecLine[8] != "occu_icon") { Ex.Logger.Log("Role.csv中字段[occu_icon]位置不对应"); return(false); } if (vecLine[9] != "create_occu_icon") { Ex.Logger.Log("Role.csv中字段[create_occu_icon]位置不对应"); return(false); } if (vecLine[10] != "occu_name") { Ex.Logger.Log("Role.csv中字段[occu_name]位置不对应"); return(false); } if (vecLine[11] != "occu_desc") { Ex.Logger.Log("Role.csv中字段[occu_desc]位置不对应"); return(false); } if (vecLine[12] != "occu_evaluate") { Ex.Logger.Log("Role.csv中字段[occu_evaluate]位置不对应"); return(false); } if (vecLine[13] != "model_id") { Ex.Logger.Log("Role.csv中字段[model_id]位置不对应"); return(false); } if (vecLine[14] != "strength") { Ex.Logger.Log("Role.csv中字段[strength]位置不对应"); return(false); } if (vecLine[15] != "speed ") { Ex.Logger.Log("Role.csv中字段[speed ]位置不对应"); return(false); } if (vecLine[16] != "agile") { Ex.Logger.Log("Role.csv中字段[agile]位置不对应"); return(false); } if (vecLine[17] != "stamina") { Ex.Logger.Log("Role.csv中字段[stamina]位置不对应"); return(false); } if (vecLine[18] != "spirit") { Ex.Logger.Log("Role.csv中字段[spirit]位置不对应"); return(false); } if (vecLine[19] != "maxhp") { Ex.Logger.Log("Role.csv中字段[maxhp]位置不对应"); return(false); } if (vecLine[20] != "maxmp") { Ex.Logger.Log("Role.csv中字段[maxmp]位置不对应"); return(false); } if (vecLine[21] != "physic_attack") { Ex.Logger.Log("Role.csv中字段[physic_attack]位置不对应"); return(false); } if (vecLine[22] != "physic_defense") { Ex.Logger.Log("Role.csv中字段[physic_defense]位置不对应"); return(false); } if (vecLine[23] != "magic_attack") { Ex.Logger.Log("Role.csv中字段[magic_attack]位置不对应"); return(false); } if (vecLine[24] != "magic_defense") { Ex.Logger.Log("Role.csv中字段[magic_defense]位置不对应"); return(false); } if (vecLine[25] != "hit_value") { Ex.Logger.Log("Role.csv中字段[hit_value]位置不对应"); return(false); } if (vecLine[26] != "hit_rate") { Ex.Logger.Log("Role.csv中字段[hit_rate]位置不对应"); return(false); } if (vecLine[27] != "miss_value") { Ex.Logger.Log("Role.csv中字段[miss_value]位置不对应"); return(false); } if (vecLine[28] != "miss_rate") { Ex.Logger.Log("Role.csv中字段[miss_rate]位置不对应"); return(false); } if (vecLine[29] != "critical_value") { Ex.Logger.Log("Role.csv中字段[critical_value]位置不对应"); return(false); } if (vecLine[30] != "critical_rate") { Ex.Logger.Log("Role.csv中字段[critical_rate]位置不对应"); return(false); } if (vecLine[31] != "tenacity_value") { Ex.Logger.Log("Role.csv中字段[tenacity_value]位置不对应"); return(false); } if (vecLine[32] != "tenacity_rate") { Ex.Logger.Log("Role.csv中字段[tenacity_rate]位置不对应"); return(false); } if (vecLine[33] != "dodge_value") { Ex.Logger.Log("Role.csv中字段[dodge_value]位置不对应"); return(false); } if (vecLine[34] != "dodge_rate") { Ex.Logger.Log("Role.csv中字段[dodge_rate]位置不对应"); return(false); } if (vecLine[35] != "penetrate_value") { Ex.Logger.Log("Role.csv中字段[penetrate_value]位置不对应"); return(false); } if (vecLine[36] != "penetrate_rate") { Ex.Logger.Log("Role.csv中字段[penetrate_rate]位置不对应"); return(false); } if (vecLine[37] != "miss_level") { Ex.Logger.Log("Role.csv中字段[miss_level]位置不对应"); return(false); } if (vecLine[38] != "critical_level") { Ex.Logger.Log("Role.csv中字段[critical_level]位置不对应"); return(false); } if (vecLine[39] != "dodge_level") { Ex.Logger.Log("Role.csv中字段[dodge_level]位置不对应"); return(false); } if (vecLine[40] != "move_speed") { Ex.Logger.Log("Role.csv中字段[move_speed]位置不对应"); return(false); } if (vecLine[41] != "physic_oppose") { Ex.Logger.Log("Role.csv中字段[physic_oppose]位置不对应"); return(false); } if (vecLine[42] != "magic_oppose") { Ex.Logger.Log("Role.csv中字段[magic_oppose]位置不对应"); return(false); } if (vecLine[43] != "physic_add") { Ex.Logger.Log("Role.csv中字段[physic_add]位置不对应"); return(false); } if (vecLine[44] != "magic_add") { Ex.Logger.Log("Role.csv中字段[magic_add]位置不对应"); return(false); } if (vecLine[45] != "scene_id") { Ex.Logger.Log("Role.csv中字段[scene_id]位置不对应"); return(false); } if (vecLine[46] != "posx") { Ex.Logger.Log("Role.csv中字段[posx]位置不对应"); return(false); } if (vecLine[47] != "posz") { Ex.Logger.Log("Role.csv中字段[posz]位置不对应"); return(false); } if (vecLine[48] != "direct") { Ex.Logger.Log("Role.csv中字段[direct]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)49) { return(false); } RoleElement member = new RoleElement(); member.id = Convert.ToInt32(vecLine[0]); member.comment = vecLine[1]; member.race = Convert.ToInt32(vecLine[2]); member.occupation = Convert.ToInt32(vecLine[3]); member.gender = Convert.ToInt32(vecLine[4]); member.race_icon = vecLine[5]; member.race_name = Convert.ToInt32(vecLine[6]); member.race_desc = Convert.ToInt32(vecLine[7]); member.occu_icon = vecLine[8]; member.create_occu_icon = vecLine[9]; member.occu_name = Convert.ToInt32(vecLine[10]); member.occu_desc = Convert.ToInt32(vecLine[11]); member.occu_evaluate = vecLine[12]; member.model_id = Convert.ToInt32(vecLine[13]); member.strength = Convert.ToInt32(vecLine[14]); member.speed = Convert.ToInt32(vecLine[15]); member.agile = Convert.ToInt32(vecLine[16]); member.stamina = Convert.ToInt32(vecLine[17]); member.spirit = Convert.ToInt32(vecLine[18]); member.maxhp = Convert.ToInt32(vecLine[19]); member.maxmp = Convert.ToInt32(vecLine[20]); member.physic_attack = Convert.ToInt32(vecLine[21]); member.physic_defense = Convert.ToInt32(vecLine[22]); member.magic_attack = Convert.ToInt32(vecLine[23]); member.magic_defense = Convert.ToInt32(vecLine[24]); member.hit_value = Convert.ToInt32(vecLine[25]); member.hit_rate = Convert.ToInt32(vecLine[26]); member.miss_value = Convert.ToInt32(vecLine[27]); member.miss_rate = Convert.ToInt32(vecLine[28]); member.critical_value = Convert.ToInt32(vecLine[29]); member.critical_rate = Convert.ToInt32(vecLine[30]); member.tenacity_value = Convert.ToInt32(vecLine[31]); member.tenacity_rate = Convert.ToInt32(vecLine[32]); member.dodge_value = Convert.ToInt32(vecLine[33]); member.dodge_rate = Convert.ToInt32(vecLine[34]); member.penetrate_value = Convert.ToInt32(vecLine[35]); member.penetrate_rate = Convert.ToInt32(vecLine[36]); member.miss_level = Convert.ToInt32(vecLine[37]); member.critical_level = Convert.ToInt32(vecLine[38]); member.dodge_level = Convert.ToInt32(vecLine[39]); member.move_speed = Convert.ToInt32(vecLine[40]); member.physic_oppose = Convert.ToInt32(vecLine[41]); member.magic_oppose = Convert.ToInt32(vecLine[42]); member.physic_add = Convert.ToInt32(vecLine[43]); member.magic_add = Convert.ToInt32(vecLine[44]); member.scene_id = Convert.ToInt32(vecLine[45]); member.posx = Convert.ToSingle(vecLine[46]); member.posz = Convert.ToSingle(vecLine[47]); member.direct = Convert.ToSingle(vecLine[48]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.id] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 8) { Ex.Logger.Log("BaoShiJiBan.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("BaoShiJiBan.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Name") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "Set") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Set]位置不对应"); return(false); } if (vecLine[3] != "Lv") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Lv]位置不对应"); return(false); } if (vecLine[4] != "KongShu") { Ex.Logger.Log("BaoShiJiBan.csv中字段[KongShu]位置不对应"); return(false); } if (vecLine[5] != "BaoShi") { Ex.Logger.Log("BaoShiJiBan.csv中字段[BaoShi]位置不对应"); return(false); } if (vecLine[6] != "Attr") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Attr]位置不对应"); return(false); } if (vecLine[7] != "Num") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Num]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)8) { return(false); } BaoShiJiBanElement member = new BaoShiJiBanElement(); member.ID = Convert.ToInt32(vecLine[0]); member.Name = vecLine[1]; member.Set = Convert.ToInt32(vecLine[2]); member.Lv = Convert.ToInt32(vecLine[3]); member.KongShu = Convert.ToInt32(vecLine[4]); member.BaoShi = vecLine[5]; member.Attr = vecLine[6]; member.Num = vecLine[7]; member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 10) { Ex.Logger.Log("FBEvent.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("FBEvent.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "TriggerType1") { Ex.Logger.Log("FBEvent.csv中字段[TriggerType1]位置不对应"); return(false); } if (vecLine[2] != "TriggerArgs1") { Ex.Logger.Log("FBEvent.csv中字段[TriggerArgs1]位置不对应"); return(false); } if (vecLine[3] != "TriggerType2") { Ex.Logger.Log("FBEvent.csv中字段[TriggerType2]位置不对应"); return(false); } if (vecLine[4] != "TriggerArgs2") { Ex.Logger.Log("FBEvent.csv中字段[TriggerArgs2]位置不对应"); return(false); } if (vecLine[5] != "ContinueTime") { Ex.Logger.Log("FBEvent.csv中字段[ContinueTime]位置不对应"); return(false); } if (vecLine[6] != "EventType") { Ex.Logger.Log("FBEvent.csv中字段[EventType]位置不对应"); return(false); } if (vecLine[7] != "EventArgs") { Ex.Logger.Log("FBEvent.csv中字段[EventArgs]位置不对应"); return(false); } if (vecLine[8] != "EventTimes") { Ex.Logger.Log("FBEvent.csv中字段[EventTimes]位置不对应"); return(false); } if (vecLine[9] != "Next") { Ex.Logger.Log("FBEvent.csv中字段[Next]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)10) { return(false); } FBEventElement member = new FBEventElement(); member.ID = Convert.ToInt32(vecLine[0]); member.TriggerType1 = Convert.ToInt32(vecLine[1]); member.TriggerArgs1 = Convert.ToInt32(vecLine[2]); member.TriggerType2 = Convert.ToInt32(vecLine[3]); member.TriggerArgs2 = Convert.ToInt32(vecLine[4]); member.ContinueTime = Convert.ToInt32(vecLine[5]); member.EventType = Convert.ToInt32(vecLine[6]); member.EventArgs = Convert.ToInt32(vecLine[7]); member.EventTimes = Convert.ToInt32(vecLine[8]); member.Next = Convert.ToInt32(vecLine[9]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 9) { Ex.Logger.Log("BangHuiManager.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "Type") { Ex.Logger.Log("BangHuiManager.csv中字段[Type]位置不对应"); return(false); } if (vecLine[1] != "Name") { Ex.Logger.Log("BangHuiManager.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "RenMing") { Ex.Logger.Log("BangHuiManager.csv中字段[RenMing]位置不对应"); return(false); } if (vecLine[3] != "PiZhun") { Ex.Logger.Log("BangHuiManager.csv中字段[PiZhun]位置不对应"); return(false); } if (vecLine[4] != "YaoQing") { Ex.Logger.Log("BangHuiManager.csv中字段[YaoQing]位置不对应"); return(false); } if (vecLine[5] != "TiChu") { Ex.Logger.Log("BangHuiManager.csv中字段[TiChu]位置不对应"); return(false); } if (vecLine[6] != "IsRenMing") { Ex.Logger.Log("BangHuiManager.csv中字段[IsRenMing]位置不对应"); return(false); } if (vecLine[7] != "CiZhi") { Ex.Logger.Log("BangHuiManager.csv中字段[CiZhi]位置不对应"); return(false); } if (vecLine[8] != "Num") { Ex.Logger.Log("BangHuiManager.csv中字段[Num]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)9) { return(false); } BangHuiManagerElement member = new BangHuiManagerElement(); member.Type = Convert.ToInt32(vecLine[0]); member.Name = vecLine[1]; member.RenMing = Convert.ToInt32(vecLine[2]); member.PiZhun = Convert.ToInt32(vecLine[3]); member.YaoQing = Convert.ToInt32(vecLine[4]); member.TiChu = Convert.ToInt32(vecLine[5]); member.IsRenMing = Convert.ToInt32(vecLine[6]); member.CiZhi = Convert.ToInt32(vecLine[7]); member.Num = Convert.ToInt32(vecLine[8]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.Type] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 5) { Ex.Logger.Log("Cargo.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("Cargo.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "GoodsId") { Ex.Logger.Log("Cargo.csv中字段[GoodsId]位置不对应"); return(false); } if (vecLine[2] != "Name") { Ex.Logger.Log("Cargo.csv中字段[Name]位置不对应"); return(false); } if (vecLine[3] != "Number") { Ex.Logger.Log("Cargo.csv中字段[Number]位置不对应"); return(false); } if (vecLine[4] != "Type") { Ex.Logger.Log("Cargo.csv中字段[Type]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { CargoElement member = new CargoElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.GoodsId); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Number); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Type); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 9) { Debug.Log("NiudanBase.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("NiudanBase.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "NiudanID") { Debug.Log("NiudanBase.csv中字段[NiudanID]位置不对应"); return(false); } if (vecLine[2] != "Name") { Debug.Log("NiudanBase.csv中字段[Name]位置不对应"); return(false); } if (vecLine[3] != "XiaoHao") { Debug.Log("NiudanBase.csv中字段[XiaoHao]位置不对应"); return(false); } if (vecLine[4] != "Num") { Debug.Log("NiudanBase.csv中字段[Num]位置不对应"); return(false); } if (vecLine[5] != "ManyNum") { Debug.Log("NiudanBase.csv中字段[ManyNum]位置不对应"); return(false); } if (vecLine[6] != "Many") { Debug.Log("NiudanBase.csv中字段[Many]位置不对应"); return(false); } if (vecLine[7] != "Free") { Debug.Log("NiudanBase.csv中字段[Free]位置不对应"); return(false); } if (vecLine[8] != "Count") { Debug.Log("NiudanBase.csv中字段[Count]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)9) { return(false); } NiudanBaseElement member = new NiudanBaseElement(); member.ID = Convert.ToInt32(vecLine[0]); member.NiudanID = Convert.ToInt32(vecLine[1]); member.Name = vecLine[2]; member.XiaoHao = Convert.ToInt32(vecLine[3]); member.Num = Convert.ToInt32(vecLine[4]); member.ManyNum = Convert.ToInt32(vecLine[5]); member.Many = Convert.ToInt32(vecLine[6]); member.Free = Convert.ToInt32(vecLine[7]); member.Count = Convert.ToInt32(vecLine[8]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 20) { Debug.Log("HeroTM.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "Hero") { Debug.Log("HeroTM.csv中字段[Hero]位置不对应"); return(false); } if (vecLine[1] != "Type") { Debug.Log("HeroTM.csv中字段[Type]位置不对应"); return(false); } if (vecLine[2] != "LV") { Debug.Log("HeroTM.csv中字段[LV]位置不对应"); return(false); } if (vecLine[3] != "ID1") { Debug.Log("HeroTM.csv中字段[ID1]位置不对应"); return(false); } if (vecLine[4] != "Num1") { Debug.Log("HeroTM.csv中字段[Num1]位置不对应"); return(false); } if (vecLine[5] != "ID2") { Debug.Log("HeroTM.csv中字段[ID2]位置不对应"); return(false); } if (vecLine[6] != "Num2") { Debug.Log("HeroTM.csv中字段[Num2]位置不对应"); return(false); } if (vecLine[7] != "ID3") { Debug.Log("HeroTM.csv中字段[ID3]位置不对应"); return(false); } if (vecLine[8] != "Num3") { Debug.Log("HeroTM.csv中字段[Num3]位置不对应"); return(false); } if (vecLine[9] != "ID4") { Debug.Log("HeroTM.csv中字段[ID4]位置不对应"); return(false); } if (vecLine[10] != "Num4") { Debug.Log("HeroTM.csv中字段[Num4]位置不对应"); return(false); } if (vecLine[11] != "ID5") { Debug.Log("HeroTM.csv中字段[ID5]位置不对应"); return(false); } if (vecLine[12] != "Num5") { Debug.Log("HeroTM.csv中字段[Num5]位置不对应"); return(false); } if (vecLine[13] != "ID6") { Debug.Log("HeroTM.csv中字段[ID6]位置不对应"); return(false); } if (vecLine[14] != "Num6") { Debug.Log("HeroTM.csv中字段[Num6]位置不对应"); return(false); } if (vecLine[15] != "Pattack") { Debug.Log("HeroTM.csv中字段[Pattack]位置不对应"); return(false); } if (vecLine[16] != "Mattack") { Debug.Log("HeroTM.csv中字段[Mattack]位置不对应"); return(false); } if (vecLine[17] != "PDefense") { Debug.Log("HeroTM.csv中字段[PDefense]位置不对应"); return(false); } if (vecLine[18] != "MDefense") { Debug.Log("HeroTM.csv中字段[MDefense]位置不对应"); return(false); } if (vecLine[19] != "HP") { Debug.Log("HeroTM.csv中字段[HP]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { HeroTMElement member = new HeroTMElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Hero); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Type); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LV); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID3); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num3); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID4); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num4); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID5); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num5); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID6); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num6); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Pattack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Mattack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.PDefense); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.MDefense); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.HP); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.Hero] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 20) { Debug.Log("HeroTM.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "Hero") { Debug.Log("HeroTM.csv中字段[Hero]位置不对应"); return(false); } if (vecLine[1] != "Type") { Debug.Log("HeroTM.csv中字段[Type]位置不对应"); return(false); } if (vecLine[2] != "LV") { Debug.Log("HeroTM.csv中字段[LV]位置不对应"); return(false); } if (vecLine[3] != "ID1") { Debug.Log("HeroTM.csv中字段[ID1]位置不对应"); return(false); } if (vecLine[4] != "Num1") { Debug.Log("HeroTM.csv中字段[Num1]位置不对应"); return(false); } if (vecLine[5] != "ID2") { Debug.Log("HeroTM.csv中字段[ID2]位置不对应"); return(false); } if (vecLine[6] != "Num2") { Debug.Log("HeroTM.csv中字段[Num2]位置不对应"); return(false); } if (vecLine[7] != "ID3") { Debug.Log("HeroTM.csv中字段[ID3]位置不对应"); return(false); } if (vecLine[8] != "Num3") { Debug.Log("HeroTM.csv中字段[Num3]位置不对应"); return(false); } if (vecLine[9] != "ID4") { Debug.Log("HeroTM.csv中字段[ID4]位置不对应"); return(false); } if (vecLine[10] != "Num4") { Debug.Log("HeroTM.csv中字段[Num4]位置不对应"); return(false); } if (vecLine[11] != "ID5") { Debug.Log("HeroTM.csv中字段[ID5]位置不对应"); return(false); } if (vecLine[12] != "Num5") { Debug.Log("HeroTM.csv中字段[Num5]位置不对应"); return(false); } if (vecLine[13] != "ID6") { Debug.Log("HeroTM.csv中字段[ID6]位置不对应"); return(false); } if (vecLine[14] != "Num6") { Debug.Log("HeroTM.csv中字段[Num6]位置不对应"); return(false); } if (vecLine[15] != "Pattack") { Debug.Log("HeroTM.csv中字段[Pattack]位置不对应"); return(false); } if (vecLine[16] != "Mattack") { Debug.Log("HeroTM.csv中字段[Mattack]位置不对应"); return(false); } if (vecLine[17] != "PDefense") { Debug.Log("HeroTM.csv中字段[PDefense]位置不对应"); return(false); } if (vecLine[18] != "MDefense") { Debug.Log("HeroTM.csv中字段[MDefense]位置不对应"); return(false); } if (vecLine[19] != "HP") { Debug.Log("HeroTM.csv中字段[HP]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)20) { return(false); } HeroTMElement member = new HeroTMElement(); member.Hero = Convert.ToInt32(vecLine[0]); member.Type = Convert.ToInt32(vecLine[1]); member.LV = Convert.ToInt32(vecLine[2]); member.ID1 = Convert.ToInt32(vecLine[3]); member.Num1 = Convert.ToInt32(vecLine[4]); member.ID2 = Convert.ToInt32(vecLine[5]); member.Num2 = Convert.ToInt32(vecLine[6]); member.ID3 = Convert.ToInt32(vecLine[7]); member.Num3 = Convert.ToInt32(vecLine[8]); member.ID4 = Convert.ToInt32(vecLine[9]); member.Num4 = Convert.ToInt32(vecLine[10]); member.ID5 = Convert.ToInt32(vecLine[11]); member.Num5 = Convert.ToInt32(vecLine[12]); member.ID6 = Convert.ToInt32(vecLine[13]); member.Num6 = Convert.ToInt32(vecLine[14]); member.Pattack = Convert.ToInt32(vecLine[15]); member.Mattack = Convert.ToInt32(vecLine[16]); member.PDefense = Convert.ToInt32(vecLine[17]); member.MDefense = Convert.ToInt32(vecLine[18]); member.HP = Convert.ToInt32(vecLine[19]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.Hero] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 16) { Debug.Log("EquipColour.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("EquipColour.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "EquipID") { Debug.Log("EquipColour.csv中字段[EquipID]位置不对应"); return(false); } if (vecLine[2] != "Name") { Debug.Log("EquipColour.csv中字段[Name]位置不对应"); return(false); } if (vecLine[3] != "Res") { Debug.Log("EquipColour.csv中字段[Res]位置不对应"); return(false); } if (vecLine[4] != "Item1") { Debug.Log("EquipColour.csv中字段[Item1]位置不对应"); return(false); } if (vecLine[5] != "Num1") { Debug.Log("EquipColour.csv中字段[Num1]位置不对应"); return(false); } if (vecLine[6] != "Money") { Debug.Log("EquipColour.csv中字段[Money]位置不对应"); return(false); } if (vecLine[7] != "Decompose") { Debug.Log("EquipColour.csv中字段[Decompose]位置不对应"); return(false); } if (vecLine[8] != "DecomposeID") { Debug.Log("EquipColour.csv中字段[DecomposeID]位置不对应"); return(false); } if (vecLine[9] != "Nummin") { Debug.Log("EquipColour.csv中字段[Nummin]位置不对应"); return(false); } if (vecLine[10] != "Nummax") { Debug.Log("EquipColour.csv中字段[Nummax]位置不对应"); return(false); } if (vecLine[11] != "Price") { Debug.Log("EquipColour.csv中字段[Price]位置不对应"); return(false); } if (vecLine[12] != "Item2") { Debug.Log("EquipColour.csv中字段[Item2]位置不对应"); return(false); } if (vecLine[13] != "Num2") { Debug.Log("EquipColour.csv中字段[Num2]位置不对应"); return(false); } if (vecLine[14] != "Item3") { Debug.Log("EquipColour.csv中字段[Item3]位置不对应"); return(false); } if (vecLine[15] != "Num3") { Debug.Log("EquipColour.csv中字段[Num3]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { EquipColourElement member = new EquipColourElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.EquipID); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadString(binContent, readPos, out member.Res); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Item1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Money); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Decompose); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.DecomposeID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Nummin); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Nummax); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Price); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Item2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Item3); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num3); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 16) { Debug.Log("EquipColour.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("EquipColour.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "EquipID") { Debug.Log("EquipColour.csv中字段[EquipID]位置不对应"); return(false); } if (vecLine[2] != "Name") { Debug.Log("EquipColour.csv中字段[Name]位置不对应"); return(false); } if (vecLine[3] != "Res") { Debug.Log("EquipColour.csv中字段[Res]位置不对应"); return(false); } if (vecLine[4] != "Item1") { Debug.Log("EquipColour.csv中字段[Item1]位置不对应"); return(false); } if (vecLine[5] != "Num1") { Debug.Log("EquipColour.csv中字段[Num1]位置不对应"); return(false); } if (vecLine[6] != "Money") { Debug.Log("EquipColour.csv中字段[Money]位置不对应"); return(false); } if (vecLine[7] != "Decompose") { Debug.Log("EquipColour.csv中字段[Decompose]位置不对应"); return(false); } if (vecLine[8] != "DecomposeID") { Debug.Log("EquipColour.csv中字段[DecomposeID]位置不对应"); return(false); } if (vecLine[9] != "Nummin") { Debug.Log("EquipColour.csv中字段[Nummin]位置不对应"); return(false); } if (vecLine[10] != "Nummax") { Debug.Log("EquipColour.csv中字段[Nummax]位置不对应"); return(false); } if (vecLine[11] != "Price") { Debug.Log("EquipColour.csv中字段[Price]位置不对应"); return(false); } if (vecLine[12] != "Item2") { Debug.Log("EquipColour.csv中字段[Item2]位置不对应"); return(false); } if (vecLine[13] != "Num2") { Debug.Log("EquipColour.csv中字段[Num2]位置不对应"); return(false); } if (vecLine[14] != "Item3") { Debug.Log("EquipColour.csv中字段[Item3]位置不对应"); return(false); } if (vecLine[15] != "Num3") { Debug.Log("EquipColour.csv中字段[Num3]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)16) { return(false); } EquipColourElement member = new EquipColourElement(); member.ID = Convert.ToInt32(vecLine[0]); member.EquipID = Convert.ToInt32(vecLine[1]); member.Name = vecLine[2]; member.Res = vecLine[3]; member.Item1 = Convert.ToInt32(vecLine[4]); member.Num1 = Convert.ToInt32(vecLine[5]); member.Money = Convert.ToInt32(vecLine[6]); member.Decompose = Convert.ToInt32(vecLine[7]); member.DecomposeID = Convert.ToInt32(vecLine[8]); member.Nummin = Convert.ToInt32(vecLine[9]); member.Nummax = Convert.ToInt32(vecLine[10]); member.Price = Convert.ToInt32(vecLine[11]); member.Item2 = Convert.ToInt32(vecLine[12]); member.Num2 = Convert.ToInt32(vecLine[13]); member.Item3 = Convert.ToInt32(vecLine[14]); member.Num3 = Convert.ToInt32(vecLine[15]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public void UpdateField(int Id, int Index, byte[] buff, int start, int len) { SyncIdE SyncId = (SyncIdE)Id; byte[] updateBuffer = new byte[len]; Array.Copy(buff, start, updateBuffer, 0, len); int iValue = 0; long lValue = 0; switch (SyncId) { case SyncIdE.USERNAME: m_Instance.UserName = System.Text.Encoding.UTF8.GetString(updateBuffer); break; case SyncIdE.USERID: GameAssist.ReadInt64Variant(updateBuffer, 0, out lValue); m_Instance.UserId = lValue; break; case SyncIdE.PLATNAME: m_Instance.PlatName = System.Text.Encoding.UTF8.GetString(updateBuffer); break; case SyncIdE.ACCOUNTID: GameAssist.ReadInt64Variant(updateBuffer, 0, out lValue); m_Instance.AccountId = lValue; break; case SyncIdE.LEVEL: GameAssist.ReadInt32Variant(updateBuffer, 0, out iValue); m_Instance.Level = iValue; break; case SyncIdE.RANK: GameAssist.ReadInt32Variant(updateBuffer, 0, out iValue); m_Instance.Rank = iValue; break; case SyncIdE.FIGHTPOWER: GameAssist.ReadInt32Variant(updateBuffer, 0, out iValue); m_Instance.FightPower = iValue; break; case SyncIdE.SEC: GameAssist.ReadInt32Variant(updateBuffer, 0, out iValue); m_Instance.Sec = iValue; break; case SyncIdE.MILITARY: GameAssist.ReadInt32Variant(updateBuffer, 0, out iValue); m_Instance.Military = iValue; break; default: break; } try { if (NotifySyncValueChanged != null) { NotifySyncValueChanged(Id, Index); } } catch { Debug.Log("PersistAttrData.NotifySyncValueChanged catch exception"); } updateBuffer.GetType(); iValue++; lValue++; }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 14) { Debug.Log("Military.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("Military.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Pattack") { Debug.Log("Military.csv中字段[Pattack]位置不对应"); return(false); } if (vecLine[2] != "Mattack") { Debug.Log("Military.csv中字段[Mattack]位置不对应"); return(false); } if (vecLine[3] != "PDefense") { Debug.Log("Military.csv中字段[PDefense]位置不对应"); return(false); } if (vecLine[4] != "MDefense") { Debug.Log("Military.csv中字段[MDefense]位置不对应"); return(false); } if (vecLine[5] != "HP") { Debug.Log("Military.csv中字段[HP]位置不对应"); return(false); } if (vecLine[6] != "Baoji") { Debug.Log("Military.csv中字段[Baoji]位置不对应"); return(false); } if (vecLine[7] != "Bisha") { Debug.Log("Military.csv中字段[Bisha]位置不对应"); return(false); } if (vecLine[8] != "MP") { Debug.Log("Military.csv中字段[MP]位置不对应"); return(false); } if (vecLine[9] != "MpHuifu") { Debug.Log("Military.csv中字段[MpHuifu]位置不对应"); return(false); } if (vecLine[10] != "Renxing") { Debug.Log("Military.csv中字段[Renxing]位置不对应"); return(false); } if (vecLine[11] != "Shouhu") { Debug.Log("Military.csv中字段[Shouhu]位置不对应"); return(false); } if (vecLine[12] != "HpHuifu") { Debug.Log("Military.csv中字段[HpHuifu]位置不对应"); return(false); } if (vecLine[13] != "Skilllevel") { Debug.Log("Military.csv中字段[Skilllevel]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)14) { return(false); } MilitaryElement member = new MilitaryElement(); member.ID = Convert.ToInt32(vecLine[0]); member.Pattack = Convert.ToSingle(vecLine[1]); member.Mattack = Convert.ToSingle(vecLine[2]); member.PDefense = Convert.ToSingle(vecLine[3]); member.MDefense = Convert.ToSingle(vecLine[4]); member.HP = Convert.ToSingle(vecLine[5]); member.Baoji = Convert.ToSingle(vecLine[6]); member.Bisha = Convert.ToSingle(vecLine[7]); member.MP = Convert.ToSingle(vecLine[8]); member.MpHuifu = Convert.ToSingle(vecLine[9]); member.Renxing = Convert.ToSingle(vecLine[10]); member.Shouhu = Convert.ToSingle(vecLine[11]); member.HpHuifu = Convert.ToSingle(vecLine[12]); member.Skilllevel = Convert.ToSingle(vecLine[13]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 14) { Debug.Log("Military.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("Military.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Pattack") { Debug.Log("Military.csv中字段[Pattack]位置不对应"); return(false); } if (vecLine[2] != "Mattack") { Debug.Log("Military.csv中字段[Mattack]位置不对应"); return(false); } if (vecLine[3] != "PDefense") { Debug.Log("Military.csv中字段[PDefense]位置不对应"); return(false); } if (vecLine[4] != "MDefense") { Debug.Log("Military.csv中字段[MDefense]位置不对应"); return(false); } if (vecLine[5] != "HP") { Debug.Log("Military.csv中字段[HP]位置不对应"); return(false); } if (vecLine[6] != "Baoji") { Debug.Log("Military.csv中字段[Baoji]位置不对应"); return(false); } if (vecLine[7] != "Bisha") { Debug.Log("Military.csv中字段[Bisha]位置不对应"); return(false); } if (vecLine[8] != "MP") { Debug.Log("Military.csv中字段[MP]位置不对应"); return(false); } if (vecLine[9] != "MpHuifu") { Debug.Log("Military.csv中字段[MpHuifu]位置不对应"); return(false); } if (vecLine[10] != "Renxing") { Debug.Log("Military.csv中字段[Renxing]位置不对应"); return(false); } if (vecLine[11] != "Shouhu") { Debug.Log("Military.csv中字段[Shouhu]位置不对应"); return(false); } if (vecLine[12] != "HpHuifu") { Debug.Log("Military.csv中字段[HpHuifu]位置不对应"); return(false); } if (vecLine[13] != "Skilllevel") { Debug.Log("Military.csv中字段[Skilllevel]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { MilitaryElement member = new MilitaryElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Pattack); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Mattack); readPos += GameAssist.ReadFloat(binContent, readPos, out member.PDefense); readPos += GameAssist.ReadFloat(binContent, readPos, out member.MDefense); readPos += GameAssist.ReadFloat(binContent, readPos, out member.HP); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Baoji); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Bisha); readPos += GameAssist.ReadFloat(binContent, readPos, out member.MP); readPos += GameAssist.ReadFloat(binContent, readPos, out member.MpHuifu); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Renxing); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Shouhu); readPos += GameAssist.ReadFloat(binContent, readPos, out member.HpHuifu); readPos += GameAssist.ReadFloat(binContent, readPos, out member.Skilllevel); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 14) { Ex.Logger.Log("CreateRole.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "id") { Ex.Logger.Log("CreateRole.csv中字段[id]位置不对应"); return(false); } if (vecLine[1] != "race") { Ex.Logger.Log("CreateRole.csv中字段[race]位置不对应"); return(false); } if (vecLine[2] != "sex") { Ex.Logger.Log("CreateRole.csv中字段[sex]位置不对应"); return(false); } if (vecLine[3] != "race_name") { Ex.Logger.Log("CreateRole.csv中字段[race_name]位置不对应"); return(false); } if (vecLine[4] != "race_description") { Ex.Logger.Log("CreateRole.csv中字段[race_description]位置不对应"); return(false); } if (vecLine[5] != "race_icon") { Ex.Logger.Log("CreateRole.csv中字段[race_icon]位置不对应"); return(false); } if (vecLine[6] != "desc_occupations") { Ex.Logger.Log("CreateRole.csv中字段[desc_occupations]位置不对应"); return(false); } if (vecLine[7] != "default_gender") { Ex.Logger.Log("CreateRole.csv中字段[default_gender]位置不对应"); return(false); } if (vecLine[8] != "default_male_model") { Ex.Logger.Log("CreateRole.csv中字段[default_male_model]位置不对应"); return(false); } if (vecLine[9] != "default_female_model") { Ex.Logger.Log("CreateRole.csv中字段[default_female_model]位置不对应"); return(false); } if (vecLine[10] != "default_male_id") { Ex.Logger.Log("CreateRole.csv中字段[default_male_id]位置不对应"); return(false); } if (vecLine[11] != "default_female_id") { Ex.Logger.Log("CreateRole.csv中字段[default_female_id]位置不对应"); return(false); } if (vecLine[12] != "male_role_id") { Ex.Logger.Log("CreateRole.csv中字段[male_role_id]位置不对应"); return(false); } if (vecLine[13] != "female_role_id") { Ex.Logger.Log("CreateRole.csv中字段[female_role_id]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)14) { return(false); } CreateRoleElement member = new CreateRoleElement(); member.id = Convert.ToInt32(vecLine[0]); member.race = Convert.ToInt32(vecLine[1]); member.sex = vecLine[2]; member.race_name = Convert.ToInt32(vecLine[3]); member.race_description = Convert.ToInt32(vecLine[4]); member.race_icon = vecLine[5]; member.desc_occupations = Convert.ToInt32(vecLine[6]); member.default_gender = Convert.ToInt32(vecLine[7]); member.default_male_model = Convert.ToInt32(vecLine[8]); member.default_female_model = Convert.ToInt32(vecLine[9]); member.default_male_id = Convert.ToInt32(vecLine[10]); member.default_female_id = Convert.ToInt32(vecLine[11]); member.male_role_id = vecLine[12]; member.female_role_id = vecLine[13]; member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.id] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 17) { Debug.Log("BaseAI.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "baseAiId") { Debug.Log("BaseAI.csv中字段[baseAiId]位置不对应"); return(false); } if (vecLine[1] != "Comment") { Debug.Log("BaseAI.csv中字段[Comment]位置不对应"); return(false); } if (vecLine[2] != "canMove") { Debug.Log("BaseAI.csv中字段[canMove]位置不对应"); return(false); } if (vecLine[3] != "attackType") { Debug.Log("BaseAI.csv中字段[attackType]位置不对应"); return(false); } if (vecLine[4] != "aiCd") { Debug.Log("BaseAI.csv中字段[aiCd]位置不对应"); return(false); } if (vecLine[5] != "noAttack") { Debug.Log("BaseAI.csv中字段[noAttack]位置不对应"); return(false); } if (vecLine[6] != "patrolRate") { Debug.Log("BaseAI.csv中字段[patrolRate]位置不对应"); return(false); } if (vecLine[7] != "followPortal") { Debug.Log("BaseAI.csv中字段[followPortal]位置不对应"); return(false); } if (vecLine[8] != "counterAttack") { Debug.Log("BaseAI.csv中字段[counterAttack]位置不对应"); return(false); } if (vecLine[9] != "SkillPriority") { Debug.Log("BaseAI.csv中字段[SkillPriority]位置不对应"); return(false); } if (vecLine[10] != "GuardType") { Debug.Log("BaseAI.csv中字段[GuardType]位置不对应"); return(false); } if (vecLine[11] != "GuardScope") { Debug.Log("BaseAI.csv中字段[GuardScope]位置不对应"); return(false); } if (vecLine[12] != "PatrolSpeed") { Debug.Log("BaseAI.csv中字段[PatrolSpeed]位置不对应"); return(false); } if (vecLine[13] != "RaidSpeed") { Debug.Log("BaseAI.csv中字段[RaidSpeed]位置不对应"); return(false); } if (vecLine[14] != "BloodReturn") { Debug.Log("BaseAI.csv中字段[BloodReturn]位置不对应"); return(false); } if (vecLine[15] != "InterveneSkill") { Debug.Log("BaseAI.csv中字段[InterveneSkill]位置不对应"); return(false); } if (vecLine[16] != "ExpandAI") { Debug.Log("BaseAI.csv中字段[ExpandAI]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { BaseAIElement member = new BaseAIElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.baseAiId); readPos += GameAssist.ReadString(binContent, readPos, out member.Comment); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.canMove); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.attackType); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.aiCd); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.noAttack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.patrolRate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.followPortal); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.counterAttack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.SkillPriority); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.GuardType); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.GuardScope); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.PatrolSpeed); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.RaidSpeed); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.BloodReturn); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.InterveneSkill); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ExpandAI); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.baseAiId] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 5) { Ex.Logger.Log("Cargo.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("Cargo.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "GoodsId") { Ex.Logger.Log("Cargo.csv中字段[GoodsId]位置不对应"); return(false); } if (vecLine[2] != "Name") { Ex.Logger.Log("Cargo.csv中字段[Name]位置不对应"); return(false); } if (vecLine[3] != "Number") { Ex.Logger.Log("Cargo.csv中字段[Number]位置不对应"); return(false); } if (vecLine[4] != "Type") { Ex.Logger.Log("Cargo.csv中字段[Type]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)5) { return(false); } CargoElement member = new CargoElement(); member.ID = Convert.ToInt32(vecLine[0]); member.GoodsId = Convert.ToInt32(vecLine[1]); member.Name = vecLine[2]; member.Number = Convert.ToInt32(vecLine[3]); member.Type = Convert.ToInt32(vecLine[4]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 17) { Debug.Log("BaseAI.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "baseAiId") { Debug.Log("BaseAI.csv中字段[baseAiId]位置不对应"); return(false); } if (vecLine[1] != "Comment") { Debug.Log("BaseAI.csv中字段[Comment]位置不对应"); return(false); } if (vecLine[2] != "canMove") { Debug.Log("BaseAI.csv中字段[canMove]位置不对应"); return(false); } if (vecLine[3] != "attackType") { Debug.Log("BaseAI.csv中字段[attackType]位置不对应"); return(false); } if (vecLine[4] != "aiCd") { Debug.Log("BaseAI.csv中字段[aiCd]位置不对应"); return(false); } if (vecLine[5] != "noAttack") { Debug.Log("BaseAI.csv中字段[noAttack]位置不对应"); return(false); } if (vecLine[6] != "patrolRate") { Debug.Log("BaseAI.csv中字段[patrolRate]位置不对应"); return(false); } if (vecLine[7] != "followPortal") { Debug.Log("BaseAI.csv中字段[followPortal]位置不对应"); return(false); } if (vecLine[8] != "counterAttack") { Debug.Log("BaseAI.csv中字段[counterAttack]位置不对应"); return(false); } if (vecLine[9] != "SkillPriority") { Debug.Log("BaseAI.csv中字段[SkillPriority]位置不对应"); return(false); } if (vecLine[10] != "GuardType") { Debug.Log("BaseAI.csv中字段[GuardType]位置不对应"); return(false); } if (vecLine[11] != "GuardScope") { Debug.Log("BaseAI.csv中字段[GuardScope]位置不对应"); return(false); } if (vecLine[12] != "PatrolSpeed") { Debug.Log("BaseAI.csv中字段[PatrolSpeed]位置不对应"); return(false); } if (vecLine[13] != "RaidSpeed") { Debug.Log("BaseAI.csv中字段[RaidSpeed]位置不对应"); return(false); } if (vecLine[14] != "BloodReturn") { Debug.Log("BaseAI.csv中字段[BloodReturn]位置不对应"); return(false); } if (vecLine[15] != "InterveneSkill") { Debug.Log("BaseAI.csv中字段[InterveneSkill]位置不对应"); return(false); } if (vecLine[16] != "ExpandAI") { Debug.Log("BaseAI.csv中字段[ExpandAI]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)17) { return(false); } BaseAIElement member = new BaseAIElement(); member.baseAiId = Convert.ToInt32(vecLine[0]); member.Comment = vecLine[1]; member.canMove = Convert.ToInt32(vecLine[2]); member.attackType = Convert.ToInt32(vecLine[3]); member.aiCd = Convert.ToInt32(vecLine[4]); member.noAttack = Convert.ToInt32(vecLine[5]); member.patrolRate = Convert.ToInt32(vecLine[6]); member.followPortal = Convert.ToInt32(vecLine[7]); member.counterAttack = Convert.ToInt32(vecLine[8]); member.SkillPriority = Convert.ToInt32(vecLine[9]); member.GuardType = Convert.ToInt32(vecLine[10]); member.GuardScope = Convert.ToInt32(vecLine[11]); member.PatrolSpeed = Convert.ToInt32(vecLine[12]); member.RaidSpeed = Convert.ToInt32(vecLine[13]); member.BloodReturn = Convert.ToInt32(vecLine[14]); member.InterveneSkill = Convert.ToInt32(vecLine[15]); member.ExpandAI = Convert.ToInt32(vecLine[16]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.baseAiId] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 9) { Debug.Log("NiudanBase.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("NiudanBase.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "NiudanID") { Debug.Log("NiudanBase.csv中字段[NiudanID]位置不对应"); return(false); } if (vecLine[2] != "Name") { Debug.Log("NiudanBase.csv中字段[Name]位置不对应"); return(false); } if (vecLine[3] != "XiaoHao") { Debug.Log("NiudanBase.csv中字段[XiaoHao]位置不对应"); return(false); } if (vecLine[4] != "Num") { Debug.Log("NiudanBase.csv中字段[Num]位置不对应"); return(false); } if (vecLine[5] != "ManyNum") { Debug.Log("NiudanBase.csv中字段[ManyNum]位置不对应"); return(false); } if (vecLine[6] != "Many") { Debug.Log("NiudanBase.csv中字段[Many]位置不对应"); return(false); } if (vecLine[7] != "Free") { Debug.Log("NiudanBase.csv中字段[Free]位置不对应"); return(false); } if (vecLine[8] != "Count") { Debug.Log("NiudanBase.csv中字段[Count]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { NiudanBaseElement member = new NiudanBaseElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.NiudanID); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.XiaoHao); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ManyNum); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Many); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Free); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Count); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 14) { Debug.Log("Xingshi.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("Xingshi.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Name") { Debug.Log("Xingshi.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "XingShiType") { Debug.Log("Xingshi.csv中字段[XingShiType]位置不对应"); return(false); } if (vecLine[3] != "Colour") { Debug.Log("Xingshi.csv中字段[Colour]位置不对应"); return(false); } if (vecLine[4] != "Res") { Debug.Log("Xingshi.csv中字段[Res]位置不对应"); return(false); } if (vecLine[5] != "Attr1") { Debug.Log("Xingshi.csv中字段[Attr1]位置不对应"); return(false); } if (vecLine[6] != "Num1") { Debug.Log("Xingshi.csv中字段[Num1]位置不对应"); return(false); } if (vecLine[7] != "Attr2") { Debug.Log("Xingshi.csv中字段[Attr2]位置不对应"); return(false); } if (vecLine[8] != "Num2") { Debug.Log("Xingshi.csv中字段[Num2]位置不对应"); return(false); } if (vecLine[9] != "Price") { Debug.Log("Xingshi.csv中字段[Price]位置不对应"); return(false); } if (vecLine[10] != "AddNum") { Debug.Log("Xingshi.csv中字段[AddNum]位置不对应"); return(false); } if (vecLine[11] != "Exp") { Debug.Log("Xingshi.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[12] != "Max") { Debug.Log("Xingshi.csv中字段[Max]位置不对应"); return(false); } if (vecLine[13] != "Limit") { Debug.Log("Xingshi.csv中字段[Limit]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { XingshiElement member = new XingshiElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.XingShiType); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Colour); readPos += GameAssist.ReadString(binContent, readPos, out member.Res); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Attr1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Attr2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Price); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.AddNum); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Exp); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Max); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Limit); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 10) { Ex.Logger.Log("FBEvent.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("FBEvent.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "TriggerType1") { Ex.Logger.Log("FBEvent.csv中字段[TriggerType1]位置不对应"); return(false); } if (vecLine[2] != "TriggerArgs1") { Ex.Logger.Log("FBEvent.csv中字段[TriggerArgs1]位置不对应"); return(false); } if (vecLine[3] != "TriggerType2") { Ex.Logger.Log("FBEvent.csv中字段[TriggerType2]位置不对应"); return(false); } if (vecLine[4] != "TriggerArgs2") { Ex.Logger.Log("FBEvent.csv中字段[TriggerArgs2]位置不对应"); return(false); } if (vecLine[5] != "ContinueTime") { Ex.Logger.Log("FBEvent.csv中字段[ContinueTime]位置不对应"); return(false); } if (vecLine[6] != "EventType") { Ex.Logger.Log("FBEvent.csv中字段[EventType]位置不对应"); return(false); } if (vecLine[7] != "EventArgs") { Ex.Logger.Log("FBEvent.csv中字段[EventArgs]位置不对应"); return(false); } if (vecLine[8] != "EventTimes") { Ex.Logger.Log("FBEvent.csv中字段[EventTimes]位置不对应"); return(false); } if (vecLine[9] != "Next") { Ex.Logger.Log("FBEvent.csv中字段[Next]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { FBEventElement member = new FBEventElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TriggerType1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TriggerArgs1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TriggerType2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TriggerArgs2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ContinueTime); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.EventType); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.EventArgs); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.EventTimes); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Next); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 14) { Debug.Log("Xingshi.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Debug.Log("Xingshi.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Name") { Debug.Log("Xingshi.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "XingShiType") { Debug.Log("Xingshi.csv中字段[XingShiType]位置不对应"); return(false); } if (vecLine[3] != "Colour") { Debug.Log("Xingshi.csv中字段[Colour]位置不对应"); return(false); } if (vecLine[4] != "Res") { Debug.Log("Xingshi.csv中字段[Res]位置不对应"); return(false); } if (vecLine[5] != "Attr1") { Debug.Log("Xingshi.csv中字段[Attr1]位置不对应"); return(false); } if (vecLine[6] != "Num1") { Debug.Log("Xingshi.csv中字段[Num1]位置不对应"); return(false); } if (vecLine[7] != "Attr2") { Debug.Log("Xingshi.csv中字段[Attr2]位置不对应"); return(false); } if (vecLine[8] != "Num2") { Debug.Log("Xingshi.csv中字段[Num2]位置不对应"); return(false); } if (vecLine[9] != "Price") { Debug.Log("Xingshi.csv中字段[Price]位置不对应"); return(false); } if (vecLine[10] != "AddNum") { Debug.Log("Xingshi.csv中字段[AddNum]位置不对应"); return(false); } if (vecLine[11] != "Exp") { Debug.Log("Xingshi.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[12] != "Max") { Debug.Log("Xingshi.csv中字段[Max]位置不对应"); return(false); } if (vecLine[13] != "Limit") { Debug.Log("Xingshi.csv中字段[Limit]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)14) { return(false); } XingshiElement member = new XingshiElement(); member.ID = Convert.ToInt32(vecLine[0]); member.Name = vecLine[1]; member.XingShiType = Convert.ToInt32(vecLine[2]); member.Colour = Convert.ToInt32(vecLine[3]); member.Res = vecLine[4]; member.Attr1 = Convert.ToInt32(vecLine[5]); member.Num1 = Convert.ToInt32(vecLine[6]); member.Attr2 = Convert.ToInt32(vecLine[7]); member.Num2 = Convert.ToInt32(vecLine[8]); member.Price = Convert.ToInt32(vecLine[9]); member.AddNum = Convert.ToInt32(vecLine[10]); member.Exp = Convert.ToInt32(vecLine[11]); member.Max = Convert.ToInt32(vecLine[12]); member.Limit = Convert.ToInt32(vecLine[13]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 9) { Ex.Logger.Log("BangHuiManager.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "Type") { Ex.Logger.Log("BangHuiManager.csv中字段[Type]位置不对应"); return(false); } if (vecLine[1] != "Name") { Ex.Logger.Log("BangHuiManager.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "RenMing") { Ex.Logger.Log("BangHuiManager.csv中字段[RenMing]位置不对应"); return(false); } if (vecLine[3] != "PiZhun") { Ex.Logger.Log("BangHuiManager.csv中字段[PiZhun]位置不对应"); return(false); } if (vecLine[4] != "YaoQing") { Ex.Logger.Log("BangHuiManager.csv中字段[YaoQing]位置不对应"); return(false); } if (vecLine[5] != "TiChu") { Ex.Logger.Log("BangHuiManager.csv中字段[TiChu]位置不对应"); return(false); } if (vecLine[6] != "IsRenMing") { Ex.Logger.Log("BangHuiManager.csv中字段[IsRenMing]位置不对应"); return(false); } if (vecLine[7] != "CiZhi") { Ex.Logger.Log("BangHuiManager.csv中字段[CiZhi]位置不对应"); return(false); } if (vecLine[8] != "Num") { Ex.Logger.Log("BangHuiManager.csv中字段[Num]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { BangHuiManagerElement member = new BangHuiManagerElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Type); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.RenMing); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.PiZhun); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.YaoQing); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.TiChu); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.IsRenMing); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.CiZhi); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.Type] = member; } return(true); }
public bool LoadCsv(string strContent) { if (strContent.Length == 0) { return(false); } m_mapElements.Clear(); m_vecAllElements.Clear(); int contentOffset = 0; List <string> vecLine; vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if (vecLine.Count != 6) { Ex.Logger.Log("BangHuiXiuLian.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Type") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[Type]位置不对应"); return(false); } if (vecLine[2] != "Lv") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[Lv]位置不对应"); return(false); } if (vecLine[3] != "JieMian") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[JieMian]位置不对应"); return(false); } if (vecLine[4] != "Exp") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[5] != "CanShu") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[CanShu]位置不对应"); return(false); } while (true) { vecLine = GameAssist.readCsvLine(strContent, ref contentOffset); if ((int)vecLine.Count == 0) { break; } if ((int)vecLine.Count != (int)6) { return(false); } BangHuiXiuLianElement member = new BangHuiXiuLianElement(); member.ID = Convert.ToInt32(vecLine[0]); member.Type = Convert.ToInt32(vecLine[1]); member.Lv = Convert.ToInt32(vecLine[2]); member.JieMian = Convert.ToInt32(vecLine[3]); member.Exp = Convert.ToInt32(vecLine[4]); member.CanShu = Convert.ToInt32(vecLine[5]); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 49) { Ex.Logger.Log("Role.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "id") { Ex.Logger.Log("Role.csv中字段[id]位置不对应"); return(false); } if (vecLine[1] != "comment") { Ex.Logger.Log("Role.csv中字段[comment]位置不对应"); return(false); } if (vecLine[2] != "race") { Ex.Logger.Log("Role.csv中字段[race]位置不对应"); return(false); } if (vecLine[3] != "occupation") { Ex.Logger.Log("Role.csv中字段[occupation]位置不对应"); return(false); } if (vecLine[4] != "gender") { Ex.Logger.Log("Role.csv中字段[gender]位置不对应"); return(false); } if (vecLine[5] != "race_icon") { Ex.Logger.Log("Role.csv中字段[race_icon]位置不对应"); return(false); } if (vecLine[6] != "race_name") { Ex.Logger.Log("Role.csv中字段[race_name]位置不对应"); return(false); } if (vecLine[7] != "race_desc") { Ex.Logger.Log("Role.csv中字段[race_desc]位置不对应"); return(false); } if (vecLine[8] != "occu_icon") { Ex.Logger.Log("Role.csv中字段[occu_icon]位置不对应"); return(false); } if (vecLine[9] != "create_occu_icon") { Ex.Logger.Log("Role.csv中字段[create_occu_icon]位置不对应"); return(false); } if (vecLine[10] != "occu_name") { Ex.Logger.Log("Role.csv中字段[occu_name]位置不对应"); return(false); } if (vecLine[11] != "occu_desc") { Ex.Logger.Log("Role.csv中字段[occu_desc]位置不对应"); return(false); } if (vecLine[12] != "occu_evaluate") { Ex.Logger.Log("Role.csv中字段[occu_evaluate]位置不对应"); return(false); } if (vecLine[13] != "model_id") { Ex.Logger.Log("Role.csv中字段[model_id]位置不对应"); return(false); } if (vecLine[14] != "strength") { Ex.Logger.Log("Role.csv中字段[strength]位置不对应"); return(false); } if (vecLine[15] != "speed ") { Ex.Logger.Log("Role.csv中字段[speed ]位置不对应"); return(false); } if (vecLine[16] != "agile") { Ex.Logger.Log("Role.csv中字段[agile]位置不对应"); return(false); } if (vecLine[17] != "stamina") { Ex.Logger.Log("Role.csv中字段[stamina]位置不对应"); return(false); } if (vecLine[18] != "spirit") { Ex.Logger.Log("Role.csv中字段[spirit]位置不对应"); return(false); } if (vecLine[19] != "maxhp") { Ex.Logger.Log("Role.csv中字段[maxhp]位置不对应"); return(false); } if (vecLine[20] != "maxmp") { Ex.Logger.Log("Role.csv中字段[maxmp]位置不对应"); return(false); } if (vecLine[21] != "physic_attack") { Ex.Logger.Log("Role.csv中字段[physic_attack]位置不对应"); return(false); } if (vecLine[22] != "physic_defense") { Ex.Logger.Log("Role.csv中字段[physic_defense]位置不对应"); return(false); } if (vecLine[23] != "magic_attack") { Ex.Logger.Log("Role.csv中字段[magic_attack]位置不对应"); return(false); } if (vecLine[24] != "magic_defense") { Ex.Logger.Log("Role.csv中字段[magic_defense]位置不对应"); return(false); } if (vecLine[25] != "hit_value") { Ex.Logger.Log("Role.csv中字段[hit_value]位置不对应"); return(false); } if (vecLine[26] != "hit_rate") { Ex.Logger.Log("Role.csv中字段[hit_rate]位置不对应"); return(false); } if (vecLine[27] != "miss_value") { Ex.Logger.Log("Role.csv中字段[miss_value]位置不对应"); return(false); } if (vecLine[28] != "miss_rate") { Ex.Logger.Log("Role.csv中字段[miss_rate]位置不对应"); return(false); } if (vecLine[29] != "critical_value") { Ex.Logger.Log("Role.csv中字段[critical_value]位置不对应"); return(false); } if (vecLine[30] != "critical_rate") { Ex.Logger.Log("Role.csv中字段[critical_rate]位置不对应"); return(false); } if (vecLine[31] != "tenacity_value") { Ex.Logger.Log("Role.csv中字段[tenacity_value]位置不对应"); return(false); } if (vecLine[32] != "tenacity_rate") { Ex.Logger.Log("Role.csv中字段[tenacity_rate]位置不对应"); return(false); } if (vecLine[33] != "dodge_value") { Ex.Logger.Log("Role.csv中字段[dodge_value]位置不对应"); return(false); } if (vecLine[34] != "dodge_rate") { Ex.Logger.Log("Role.csv中字段[dodge_rate]位置不对应"); return(false); } if (vecLine[35] != "penetrate_value") { Ex.Logger.Log("Role.csv中字段[penetrate_value]位置不对应"); return(false); } if (vecLine[36] != "penetrate_rate") { Ex.Logger.Log("Role.csv中字段[penetrate_rate]位置不对应"); return(false); } if (vecLine[37] != "miss_level") { Ex.Logger.Log("Role.csv中字段[miss_level]位置不对应"); return(false); } if (vecLine[38] != "critical_level") { Ex.Logger.Log("Role.csv中字段[critical_level]位置不对应"); return(false); } if (vecLine[39] != "dodge_level") { Ex.Logger.Log("Role.csv中字段[dodge_level]位置不对应"); return(false); } if (vecLine[40] != "move_speed") { Ex.Logger.Log("Role.csv中字段[move_speed]位置不对应"); return(false); } if (vecLine[41] != "physic_oppose") { Ex.Logger.Log("Role.csv中字段[physic_oppose]位置不对应"); return(false); } if (vecLine[42] != "magic_oppose") { Ex.Logger.Log("Role.csv中字段[magic_oppose]位置不对应"); return(false); } if (vecLine[43] != "physic_add") { Ex.Logger.Log("Role.csv中字段[physic_add]位置不对应"); return(false); } if (vecLine[44] != "magic_add") { Ex.Logger.Log("Role.csv中字段[magic_add]位置不对应"); return(false); } if (vecLine[45] != "scene_id") { Ex.Logger.Log("Role.csv中字段[scene_id]位置不对应"); return(false); } if (vecLine[46] != "posx") { Ex.Logger.Log("Role.csv中字段[posx]位置不对应"); return(false); } if (vecLine[47] != "posz") { Ex.Logger.Log("Role.csv中字段[posz]位置不对应"); return(false); } if (vecLine[48] != "direct") { Ex.Logger.Log("Role.csv中字段[direct]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { RoleElement member = new RoleElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.id); readPos += GameAssist.ReadString(binContent, readPos, out member.comment); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.occupation); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.gender); readPos += GameAssist.ReadString(binContent, readPos, out member.race_icon); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race_name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race_desc); readPos += GameAssist.ReadString(binContent, readPos, out member.occu_icon); readPos += GameAssist.ReadString(binContent, readPos, out member.create_occu_icon); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.occu_name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.occu_desc); readPos += GameAssist.ReadString(binContent, readPos, out member.occu_evaluate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.model_id); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.strength); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.speed); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.agile); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.stamina); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.spirit); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.maxhp); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.maxmp); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.physic_attack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.physic_defense); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.magic_attack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.magic_defense); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.hit_value); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.hit_rate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.miss_value); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.miss_rate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.critical_value); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.critical_rate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.tenacity_value); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.tenacity_rate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.dodge_value); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.dodge_rate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.penetrate_value); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.penetrate_rate); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.miss_level); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.critical_level); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.dodge_level); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.move_speed); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.physic_oppose); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.magic_oppose); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.physic_add); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.magic_add); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.scene_id); readPos += GameAssist.ReadFloat(binContent, readPos, out member.posx); readPos += GameAssist.ReadFloat(binContent, readPos, out member.posz); readPos += GameAssist.ReadFloat(binContent, readPos, out member.direct); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.id] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 6) { Ex.Logger.Log("BangHuiXiuLian.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Type") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[Type]位置不对应"); return(false); } if (vecLine[2] != "Lv") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[Lv]位置不对应"); return(false); } if (vecLine[3] != "JieMian") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[JieMian]位置不对应"); return(false); } if (vecLine[4] != "Exp") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[5] != "CanShu") { Ex.Logger.Log("BangHuiXiuLian.csv中字段[CanShu]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { BangHuiXiuLianElement member = new BangHuiXiuLianElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Type); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Lv); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.JieMian); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Exp); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.CanShu); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 8) { Ex.Logger.Log("BaoShiJiBan.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "ID") { Ex.Logger.Log("BaoShiJiBan.csv中字段[ID]位置不对应"); return(false); } if (vecLine[1] != "Name") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "Set") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Set]位置不对应"); return(false); } if (vecLine[3] != "Lv") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Lv]位置不对应"); return(false); } if (vecLine[4] != "KongShu") { Ex.Logger.Log("BaoShiJiBan.csv中字段[KongShu]位置不对应"); return(false); } if (vecLine[5] != "BaoShi") { Ex.Logger.Log("BaoShiJiBan.csv中字段[BaoShi]位置不对应"); return(false); } if (vecLine[6] != "Attr") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Attr]位置不对应"); return(false); } if (vecLine[7] != "Num") { Ex.Logger.Log("BaoShiJiBan.csv中字段[Num]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { BaoShiJiBanElement member = new BaoShiJiBanElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.ID); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Set); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Lv); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.KongShu); readPos += GameAssist.ReadString(binContent, readPos, out member.BaoShi); readPos += GameAssist.ReadString(binContent, readPos, out member.Attr); readPos += GameAssist.ReadString(binContent, readPos, out member.Num); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.ID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 14) { Ex.Logger.Log("CreateRole.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "id") { Ex.Logger.Log("CreateRole.csv中字段[id]位置不对应"); return(false); } if (vecLine[1] != "race") { Ex.Logger.Log("CreateRole.csv中字段[race]位置不对应"); return(false); } if (vecLine[2] != "sex") { Ex.Logger.Log("CreateRole.csv中字段[sex]位置不对应"); return(false); } if (vecLine[3] != "race_name") { Ex.Logger.Log("CreateRole.csv中字段[race_name]位置不对应"); return(false); } if (vecLine[4] != "race_description") { Ex.Logger.Log("CreateRole.csv中字段[race_description]位置不对应"); return(false); } if (vecLine[5] != "race_icon") { Ex.Logger.Log("CreateRole.csv中字段[race_icon]位置不对应"); return(false); } if (vecLine[6] != "desc_occupations") { Ex.Logger.Log("CreateRole.csv中字段[desc_occupations]位置不对应"); return(false); } if (vecLine[7] != "default_gender") { Ex.Logger.Log("CreateRole.csv中字段[default_gender]位置不对应"); return(false); } if (vecLine[8] != "default_male_model") { Ex.Logger.Log("CreateRole.csv中字段[default_male_model]位置不对应"); return(false); } if (vecLine[9] != "default_female_model") { Ex.Logger.Log("CreateRole.csv中字段[default_female_model]位置不对应"); return(false); } if (vecLine[10] != "default_male_id") { Ex.Logger.Log("CreateRole.csv中字段[default_male_id]位置不对应"); return(false); } if (vecLine[11] != "default_female_id") { Ex.Logger.Log("CreateRole.csv中字段[default_female_id]位置不对应"); return(false); } if (vecLine[12] != "male_role_id") { Ex.Logger.Log("CreateRole.csv中字段[male_role_id]位置不对应"); return(false); } if (vecLine[13] != "female_role_id") { Ex.Logger.Log("CreateRole.csv中字段[female_role_id]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { CreateRoleElement member = new CreateRoleElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.id); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race); readPos += GameAssist.ReadString(binContent, readPos, out member.sex); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race_name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.race_description); readPos += GameAssist.ReadString(binContent, readPos, out member.race_icon); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.desc_occupations); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.default_gender); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.default_male_model); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.default_female_model); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.default_male_id); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.default_female_id); readPos += GameAssist.ReadString(binContent, readPos, out member.male_role_id); readPos += GameAssist.ReadString(binContent, readPos, out member.female_role_id); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.id] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 17) { Debug.Log("FaBao.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "LvID") { Debug.Log("FaBao.csv中字段[LvID]位置不对应"); return(false); } if (vecLine[1] != "Name") { Debug.Log("FaBao.csv中字段[Name]位置不对应"); return(false); } if (vecLine[2] != "Exp") { Debug.Log("FaBao.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[3] != "Item") { Debug.Log("FaBao.csv中字段[Item]位置不对应"); return(false); } if (vecLine[4] != "Res") { Debug.Log("FaBao.csv中字段[Res]位置不对应"); return(false); } if (vecLine[5] != "Attributu") { Debug.Log("FaBao.csv中字段[Attributu]位置不对应"); return(false); } if (vecLine[6] != "Tips") { Debug.Log("FaBao.csv中字段[Tips]位置不对应"); return(false); } if (vecLine[7] != "Tiaojian1") { Debug.Log("FaBao.csv中字段[Tiaojian1]位置不对应"); return(false); } if (vecLine[8] != "Canshu1") { Debug.Log("FaBao.csv中字段[Canshu1]位置不对应"); return(false); } if (vecLine[9] != "Tiaojian2") { Debug.Log("FaBao.csv中字段[Tiaojian2]位置不对应"); return(false); } if (vecLine[10] != "Canshu2") { Debug.Log("FaBao.csv中字段[Canshu2]位置不对应"); return(false); } if (vecLine[11] != "Tiaojian3") { Debug.Log("FaBao.csv中字段[Tiaojian3]位置不对应"); return(false); } if (vecLine[12] != "Canshu3") { Debug.Log("FaBao.csv中字段[Canshu3]位置不对应"); return(false); } if (vecLine[13] != "Tiaojian4") { Debug.Log("FaBao.csv中字段[Tiaojian4]位置不对应"); return(false); } if (vecLine[14] != "Canshu4") { Debug.Log("FaBao.csv中字段[Canshu4]位置不对应"); return(false); } if (vecLine[15] != "Tiaojian5") { Debug.Log("FaBao.csv中字段[Tiaojian5]位置不对应"); return(false); } if (vecLine[16] != "Canshu5") { Debug.Log("FaBao.csv中字段[Canshu5]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { FaBaoElement member = new FaBaoElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LvID); readPos += GameAssist.ReadString(binContent, readPos, out member.Name); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Exp); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Item); readPos += GameAssist.ReadString(binContent, readPos, out member.Res); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Attributu); readPos += GameAssist.ReadString(binContent, readPos, out member.Tips); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Tiaojian1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Canshu1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Tiaojian2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Canshu2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Tiaojian3); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Canshu3); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Tiaojian4); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Canshu4); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Tiaojian5); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Canshu5); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.LvID] = member; } return(true); }
public bool LoadBin(byte[] binContent) { m_mapElements.Clear(); m_vecAllElements.Clear(); int nCol, nRow; int readPos = 0; readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nCol); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out nRow); List <string> vecLine = new List <string>(nCol); List <int> vecHeadType = new List <int>(nCol); string tmpStr; int tmpInt; for (int i = 0; i < nCol; i++) { readPos += GameAssist.ReadString(binContent, readPos, out tmpStr); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out tmpInt); vecLine.Add(tmpStr); vecHeadType.Add(tmpInt); } if (vecLine.Count != 16) { Debug.Log("FaBaoAttribute.csv中列数量与生成的代码不匹配!"); return(false); } if (vecLine[0] != "LvID") { Debug.Log("FaBaoAttribute.csv中字段[LvID]位置不对应"); return(false); } if (vecLine[1] != "Num") { Debug.Log("FaBaoAttribute.csv中字段[Num]位置不对应"); return(false); } if (vecLine[2] != "Nor") { Debug.Log("FaBaoAttribute.csv中字段[Nor]位置不对应"); return(false); } if (vecLine[3] != "Probability1") { Debug.Log("FaBaoAttribute.csv中字段[Probability1]位置不对应"); return(false); } if (vecLine[4] != "Small") { Debug.Log("FaBaoAttribute.csv中字段[Small]位置不对应"); return(false); } if (vecLine[5] != "Probability2") { Debug.Log("FaBaoAttribute.csv中字段[Probability2]位置不对应"); return(false); } if (vecLine[6] != "Big") { Debug.Log("FaBaoAttribute.csv中字段[Big]位置不对应"); return(false); } if (vecLine[7] != "Probability3") { Debug.Log("FaBaoAttribute.csv中字段[Probability3]位置不对应"); return(false); } if (vecLine[8] != "Supper") { Debug.Log("FaBaoAttribute.csv中字段[Supper]位置不对应"); return(false); } if (vecLine[9] != "Probability4") { Debug.Log("FaBaoAttribute.csv中字段[Probability4]位置不对应"); return(false); } if (vecLine[10] != "Exp") { Debug.Log("FaBaoAttribute.csv中字段[Exp]位置不对应"); return(false); } if (vecLine[11] != "HP") { Debug.Log("FaBaoAttribute.csv中字段[HP]位置不对应"); return(false); } if (vecLine[12] != "Pattack") { Debug.Log("FaBaoAttribute.csv中字段[Pattack]位置不对应"); return(false); } if (vecLine[13] != "Mattack") { Debug.Log("FaBaoAttribute.csv中字段[Mattack]位置不对应"); return(false); } if (vecLine[14] != "PDefense") { Debug.Log("FaBaoAttribute.csv中字段[PDefense]位置不对应"); return(false); } if (vecLine[15] != "MDefense") { Debug.Log("FaBaoAttribute.csv中字段[MDefense]位置不对应"); return(false); } for (int i = 0; i < nRow; i++) { FaBaoAttributeElement member = new FaBaoAttributeElement(); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.LvID); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Num); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Nor); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Probability1); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Small); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Probability2); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Big); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Probability3); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Supper); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Probability4); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Exp); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.HP); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Pattack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.Mattack); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.PDefense); readPos += GameAssist.ReadInt32Variant(binContent, readPos, out member.MDefense); member.IsValidate = true; m_vecAllElements.Add(member); m_mapElements[member.LvID] = member; } return(true); }