} // end IsFull public Pack(string username, int roleindex, string packType) { this.packType = packType; this.username = username; this.roleindex = roleindex; idList = new string[ConstConfig.GRID_COUNT]; countList = new int[ConstConfig.GRID_COUNT]; Dictionary <int, string[]> dict; SqliteManager.GetPackInfoWithID(username, roleindex, packType, out dict); for (int i = 0; i < ConstConfig.GRID_COUNT; i++) { int count = 0; if (!dict.ContainsKey(i)) { idList[i] = "0"; continue; } // end if idList[i] = dict[i][0]; if (Configs.itemConfig.GetItemType(idList[i]) != packType) { idList[i] = "0"; } // end if if (int.TryParse(dict[i][1], out count)) { countList[i] = count; } // end if } // end for } // end Pack
} // end IsFull public EquipPack(string username, int roleindex, string packType, string roleType, ICharacterCenter center) { this.username = username; this.roleindex = roleindex; this.packType = packType; this.roleType = roleType; this.center = center; idList = new string[ConstConfig.GRID_COUNT]; #region ******** 初始化背包信息 ******** Dictionary <int, string[]> idDict; SqliteManager.GetPackInfoWithID(username, roleindex, packType, out idDict); for (int i = 0; i < ConstConfig.GRID_COUNT; i++) { if (!idDict.ContainsKey(i)) { idList[i] = "0"; continue; } // end if idList[i] = idDict[i][0]; if (Configs.itemConfig.GetItemType(idList[i]) != packType) { idList[i] = "0"; } // end if } // end for #endregion #region ******** 初始化装备穿戴信息 ******** Dictionary <string, string> initWear; SqliteManager.GetWearInfoWithID(username, roleindex, out initWear); wearDict = new Dictionary <string, IEquipInfo>(); for (int i = 0; i < ConstConfig.EquipTypeList.Length; i++) { string type = ConstConfig.EquipTypeList[i]; if (initWear.ContainsKey(type)) { wearDict[type] = Configs.itemConfig.GetItemInfo(initWear[type]) as IEquipInfo; } else { wearDict[type] = null; } // end if } // end for #endregion } // end Pack