public void Load() { CVSReader reader = new CVSReader(); reader.LoadText("Data/Config/Item_item.txt", 1); int rows = reader.GetRowCount(); for (int r = 0; r < rows; ++r) { string[] row = reader.GetRow(r); ItemItemConfig ac = ConfigProcess(row) as ItemItemConfig; configs.Add(ac.id, ac); } }
public object ConfigProcess(string[] row) { if (row.Length < 19) { return(null); } RowHelper rh = new RowHelper(row); ItemItemConfig rec = new ItemItemConfig(); rec.id = CSVUtility.ToInt(rh.Read()); //id rec.name = rh.Read(); //名称 rec.desc = rh.Read(); //描述 rec.gain = rh.Read(); //获取途径 rec.type = CSVUtility.ToInt(rh.Read()); //类型 rec.overlap = CSVUtility.ToInt(rh.Read()); //叠加上限 rec.usetype = CSVUtility.ToInt(rh.Read()); //使用效果类型 rec.usevalue = new int[2]; rec.usevalue[0] = CSVUtility.ToInt(rh.Read()); //使用效果值1 rec.usevalue[1] = CSVUtility.ToInt(rh.Read()); //使用效果值2 rec.use_times = CSVUtility.ToInt(rh.Read()); //使用次数限制 rec.cansell = CSVUtility.ToInt(rh.Read()); //是否可出售 rec.sell = new ItemItemSellConfig[2]; for (int i = 0; i < 2; i++) { rec.sell[i] = new ItemItemSellConfig(); } rec.sell[0].id = CSVUtility.ToInt(rh.Read()); //出售获得物品1 rec.sell[0].num = CSVUtility.ToInt(rh.Read()); //出售获得物品数量1 rec.sell[1].id = CSVUtility.ToInt(rh.Read()); //出售获得物品2 rec.sell[1].num = CSVUtility.ToInt(rh.Read()); //出售获得物品数量2 rec.head = rh.Read(); //小图标 rec.model = rh.Read(); //模型 rec.star = CSVUtility.ToInt(rh.Read()); //星级 rec.linkid = CSVUtility.ToInt(rh.Read()); //关联id return(rec); }
public object ConfigProcess(string[] row) { if (row.Length < 36) { return(null); } RowHelper rh = new RowHelper(row); ItemItemConfig rec = new ItemItemConfig(); rec.id = Utility.ToInt(rh.Read()); //物品ID rec.itemType = Utility.ToInt(rh.Read()); //物品类型 rec.itemLevel = Utility.ToInt(rh.Read()); //物品等级 rec.itemQuality = Utility.ToInt(rh.Read()); //物品品质 rec.levelRequest = Utility.ToInt(rh.Read()); //等级要求 rec.raceRequest = Utility.ToInt(rh.Read()); //种族要求 rec.sexRequest = Utility.ToInt(rh.Read()); //性别要求 rec.careerRequest = Utility.ToInt(rh.Read()); //职业要求 rec.otherRequest = rh.Read(); //其他要求 rec.subType = Utility.ToInt(rh.Read()); //物品细分类型 rec.functionType = Utility.ToInt(rh.Read()); //物品功能类型 rec.functionValue = rh.Read(); //物品功能参数 rec.useEffectAim = Utility.ToInt(rh.Read()); //作用目标类型 rec.aimRelation = Utility.ToInt(rh.Read()); //目标关系 rec.chantTime = Utility.ToInt(rh.Read()); //读条时间 rec.isDeathFall = Utility.ToInt(rh.Read()); //是否死亡掉落 rec.isGetBind = Utility.ToInt(rh.Read()); //是否获得绑定 rec.isCanStack = Utility.ToInt(rh.Read()); //可否堆叠 rec.isCanSell = Utility.ToInt(rh.Read()); //可否出售 rec.sellPrice = Utility.ToInt(rh.Read()); //出售价格 rec.isMarket = Utility.ToInt(rh.Read()); //可否拍卖 rec.isCanUse = Utility.ToInt(rh.Read()); //是否可使用 rec.isFightingUse = Utility.ToInt(rh.Read()); //是否可在战斗中使用 rec.isUsedDestroy = Utility.ToInt(rh.Read()); //使用后是否销毁 rec.isCanBatchUse = Utility.ToInt(rh.Read()); //是否可批量使用 rec.coolingType = Utility.ToInt(rh.Read()); //冷却类型 rec.coolingGroup = Utility.ToInt(rh.Read()); //冷却组 rec.coolingTime = Utility.ToInt(rh.Read()); //冷却时间 rec.source = new string[8]; rec.source[0] = rh.Read(); //物品来源 rec.source[1] = rh.Read(); //物品来源 rec.source[2] = rh.Read(); //物品来源 rec.source[3] = rh.Read(); //物品来源 rec.source[4] = rh.Read(); //物品来源 rec.source[5] = rh.Read(); //物品来源 rec.source[6] = rh.Read(); //物品来源 rec.source[7] = rh.Read(); //物品来源 return(rec); }