public MainCharacterPack(string roleType, ICharacterCenter center) { username = GameManager.playerInfo.username; roleindex = GameManager.playerInfo.roleindex; coin = SqliteManager.GetRoleCoinWithID(username, roleindex); packDict = new Dictionary<string, IPack>(); IEquipPack equipPack = new EquipPack(username, roleindex, ConstConfig.EQUIP, roleType, center); wearInfo = equipPack; packDict.Add(ConstConfig.EQUIP, equipPack); packDict.Add(ConstConfig.CONSUME, new Pack(username, roleindex, ConstConfig.CONSUME)); packDict.Add(ConstConfig.STUFF, new Pack(username, roleindex, ConstConfig.STUFF)); packDict.Add(ConstConfig.PRINT, new Pack(username, roleindex, ConstConfig.PRINT)); } // end MainCharacterPack
} // 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
public CharacterBuff(ICharacterCenter center) { this.center = center; signList = new List<int>(); buffList = new List<BuffTimer>(); } // end CharacterBuff