Пример #1
0
        public PokemonData(DataRow row)
        {
            this.id           = (ushort)(long)row["ID"];
            this.dexID        = (ushort)(long)row["DexID"];
            this.name         = row["Name"] as string;
            this.pokedexEntry = row["PokedexEntry"] as string ?? "";

            this.type1 = GetPokemonTypeFromString(row["Type1"] as string);
            this.type2 = (row["Type2"] as string == null ? this.type1 : GetPokemonTypeFromString(row["Type2"] as string));

            this.ability1ID = PokemonDatabase.GetAbilityIDFromString(row["Ability1"] as string);
            this.ability2ID = (row["Ability2"] as string == null ? (byte)0 : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));
            //this.ability2ID		= (row["Ability2"] as string == null ? this.ability1ID : PokemonDatabase.GetAbilityIDFromString(row["Ability2"] as string));

            this.eggGroup1 = GetEggGroupFromString(row["EggGroup1"] as string);
            this.eggGroup2 = GetEggGroupFromString(row["EggGroup2"] as string);

            this.experienceGroup = GetExperienceGroupFromString(row["ExperienceGroup"] as string);

            this.hp          = (byte)(long)row["HP"];
            this.attack      = (byte)(long)row["Attack"];
            this.defense     = (byte)(long)row["Defense"];
            this.spAttack    = (byte)(long)row["SpAttack"];
            this.spDefense   = (byte)(long)row["SpDefense"];
            this.speed       = (byte)(long)row["Speed"];
            this.genderRatio = (byte)(long)row["GenderRatio"];

            this.forms      = null;
            this.evolutions = null;

            this.learnableMoves = new List <LearnableMove>();

            this.familyDexID = this.dexID;
        }