protected override void ReadEntry(CsvEntry entry) { // Read everything first, we might need it for multiple regions. var regions = entry.ReadStringList(); var type = (WeatherInfoType)entry.ReadByte(); var values = new List <float>(); while (!entry.End) { values.Add(entry.ReadFloat()); } // Every type has at least 1 value. if (values.Count < 1) { throw new CsvDatabaseWarningException("Too few values."); } foreach (var region in regions) { var info = new WeatherData(); info.Region = Convert.ToInt32(region); info.Type = type; info.Values = values; this.Entries[info.Region] = info; } }
protected override void ReadEntry(CsvEntry entry) { var info = new PropDropItemInfo(); info.Type = entry.ReadInt(); info.ItemClass = entry.ReadInt(); info.Amount = entry.ReadUShort(); info.Chance = entry.ReadFloat(); var ii = AuraData.ItemDb.Find(info.ItemClass); if (ii == null) { throw new Exception(string.Format("Unknown item id '{0}'.", info.ItemClass)); } if (info.Amount > ii.StackMax) { info.Amount = ii.StackMax; } // The file contains PropDropItemInfo, here we organize it into PropDropInfo structs. if (!this.Entries.ContainsKey(info.Type)) { this.Entries.Add(info.Type, new PropDropData(info.Type)); } this.Entries[info.Type].Items.Add(info); }
protected override void ReadEntry(CsvEntry entry) { var info = new SpeedData(); info.Ident = entry.ReadString(); info.Speed = entry.ReadFloat(); this.Entries[info.Ident] = info; }
protected override void ReadEntry(CsvEntry entry) { var info = new ShamalaData(); info.Id = entry.ReadInt(); info.Name = entry.ReadString(); info.Category = entry.ReadString(); info.Rank = entry.ReadByte(); info.Rate = entry.ReadFloat(); info.Required = entry.ReadByte(); info.Size = entry.ReadFloat(); info.Color1 = entry.ReadUIntHex(); info.Color2 = entry.ReadUIntHex(); info.Color3 = entry.ReadUIntHex(); var races = entry.ReadStringList(); foreach (var race in races) { info.Races.Add(Convert.ToInt32(race)); } this.Entries[info.Id] = info; }
protected override void ReadEntry(CsvEntry entry) { var info = new DropData(); info.ItemId = entry.ReadInt(0); info.Chance = entry.ReadFloat(1); if (info.Chance > 100) { info.Chance = 100; } else if (info.Chance < 0) { info.Chance = 0; } this.Entries.Add(info); }
protected override void ReadEntry(CsvEntry entry) { var info = new StatsLevelUpData(); info.Age = entry.ReadByte(); info.Race = entry.ReadUShort(); info.AP = entry.ReadShort(); info.Life = entry.ReadFloat(); info.Mana = entry.ReadFloat(); info.Stamina = entry.ReadFloat(); info.Str = entry.ReadFloat(); info.Int = entry.ReadFloat(); info.Dex = entry.ReadFloat(); info.Will = entry.ReadFloat(); info.Luck = entry.ReadFloat(); if (!this.Entries.ContainsKey(info.Race)) { this.Entries[info.Race] = new Dictionary <int, StatsLevelUpData>(); } this.Entries[info.Race][info.Age] = info; }