public object ConfigProcess(string[] row) { if (row.Length < 14) { return(null); } RowHelper rh = new RowHelper(row); DisassemblygirlGirlConfig rec = new DisassemblygirlGirlConfig(); rec.id = CSVUtility.ToInt(rh.Read()); //id rec.level = CSVUtility.ToInt(rh.Read()); //级别 rec.name = rh.Read(); //名字 rec.resourceID = rh.Read(); //角色资源 rec.STR = CSVUtility.ToInt(rh.Read()); //力量 rec.VIT = CSVUtility.ToInt(rh.Read()); //体力 rec.DEX = CSVUtility.ToInt(rh.Read()); //灵巧 rec.SPD = CSVUtility.ToInt(rh.Read()); //速度 rec.weaponA = CSVUtility.ToInt(rh.Read()); //武器A rec.weaponB = CSVUtility.ToInt(rh.Read()); //武器B rec.weaponC = CSVUtility.ToInt(rh.Read()); //武器C rec.skillA = CSVUtility.ToInt(rh.Read()); //技能A rec.skillB = CSVUtility.ToInt(rh.Read()); //技能B rec.skillC = CSVUtility.ToInt(rh.Read()); //技能C return(rec); }
public static UserData CreateDefault() { UserData user = new UserData(); user.dungeonIndex = 26; user.girlID = 1; user.functions = new List <FunctionData>(); user.guides = new HashSet <int>(); user.petDatas = new List <PetData>(); user.attributeBox = AttributeBox.CreateDefault(); user.attributeBox.SetAttribute(AttributeKeys.GP, AttributeSetTypes.BaseValue, 999999); user.attributeBox.SetAttribute(AttributeKeys.RP, AttributeSetTypes.BaseValue, 999999); // Attach Pets user.petDatas.Add(PetData.FromConfig(ConfigMgr.GetInstance().DisassemblygirlPet.GetConfigById(1))); user.petDatas.Add(PetData.FromConfig(ConfigMgr.GetInstance().DisassemblygirlPet.GetConfigById(7))); user.petDatas.Add(PetData.FromConfig(ConfigMgr.GetInstance().DisassemblygirlPet.GetConfigById(13))); DisassemblygirlGirlConfig config = ConfigMgr.GetInstance().DisassemblygirlGirl.GetConfigById(user.girlID); user.girl = GirlData.FromConfig(config); // Attach Weapons user.girl.AddWeapon(7); user.girl.AddWeapon(13); user.girl.AddWeapon(19); user.girl.AddWeapon(25); user.girl.AddWeapon(31); user.girl.AddWeapon(37); // Shop Items user.shopData = new ShopData(); user.shopData.attributeBox = AttributeBox.CreateDefault(); user.shopData.attributeBox.SetAttribute(AttributeKeys.STR, AttributeSetTypes.BaseValue, 0f); user.shopData.attributeBox.SetAttribute(AttributeKeys.VIT, AttributeSetTypes.BaseValue, 0f); user.shopData.attributeBox.SetAttribute(AttributeKeys.DEX, AttributeSetTypes.BaseValue, 0f); user.shopData.attributeBox.SetAttribute(AttributeKeys.SPD, AttributeSetTypes.BaseValue, 0f); // Trophies user.trophyDatas = new List <TrophyData>(); foreach (DisassemblygirlTrophyConfig trophyConfig in ConfigMgr.GetInstance().DisassemblygirlTrophy.configs.Values) { user.trophyDatas.Add(TrophyData.FromConfig(trophyConfig)); } return(user); }
public void Load() { CSVReader reader = new CSVReader(); reader.LoadText("Config/Disassemblygirl_Girl.txt", 3); int rows = reader.GetRowCount(); for (int r = 0; r < rows; ++r) { string[] row = reader.GetRow(r); DisassemblygirlGirlConfig ac = ConfigProcess(row) as DisassemblygirlGirlConfig; configs.Add(ac.id, ac); } }
public static GirlData FromConfig(DisassemblygirlGirlConfig config) { GirlData girl = new GirlData(); girl.id = config.id; girl.name = config.name; girl.level = config.level; girl.resourceID = config.resourceID; girl.attributeBox = AttributeBox.CreateDefault(); girl.attributeBox.SetAttribute(AttributeKeys.DEX, AttributeSetTypes.BaseValue, config.DEX); girl.attributeBox.SetAttribute(AttributeKeys.VIT, AttributeSetTypes.BaseValue, config.VIT); girl.attributeBox.SetAttribute(AttributeKeys.STR, AttributeSetTypes.BaseValue, config.STR); girl.attributeBox.SetAttribute(AttributeKeys.SPD, AttributeSetTypes.BaseValue, config.SPD); girl.weapons = new List <WeaponData>(); foreach (int weaponID in new int[] { config.weaponA, config.weaponB, config.weaponC }) { girl.AddWeapon(weaponID); } return(girl); }