Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        protected override void ReadEntry(CsvEntry entry)
        {
            var info = new StatsBaseData();

            info.Age     = entry.ReadByte();
            info.Race    = entry.ReadUShort();
            info.AP      = entry.ReadByte();
            info.Life    = entry.ReadByte();
            info.Mana    = entry.ReadByte();
            info.Stamina = entry.ReadByte();
            info.Str     = entry.ReadByte();
            info.Int     = entry.ReadByte();
            info.Dex     = entry.ReadByte();
            info.Will    = entry.ReadByte();
            info.Luck    = entry.ReadByte();

            if (!this.Entries.ContainsKey(info.Race))
            {
                this.Entries[info.Race] = new Dictionary <int, StatsBaseData>();
            }

            this.Entries[info.Race][info.Age] = info;
        }
Ejemplo n.º 3
0
        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;
        }