Ejemplo n.º 1
0
        /// <summary>
        /// Sets the <see cref="PKM.Gender"/> value, with special consideration for the <see cref="PKM.Format"/> values which derive the <see cref="PKM.Gender"/> value.
        /// </summary>
        /// <param name="pk">Pokémon to modify.</param>
        /// <param name="gender">Desired <see cref="PKM.Gender"/> value to set.</param>
        public static void SetGender(this PKM pk, string gender)
        {
            int g = string.IsNullOrEmpty(gender)
                ? pk.GetSaneGender()
                : PKX.GetGenderFromString(gender);

            pk.SetGender(g);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets the <see cref="PKM.Gender"/> value, with special consideration for the <see cref="PKM.Format"/> values which derive the <see cref="PKM.Gender"/> value.
        /// </summary>
        /// <param name="pk">Pokémon to modify.</param>
        /// <param name="gender">Desired <see cref="PKM.Gender"/> value to set.</param>
        /// <remarks>Has special logic for an unspecified gender.</remarks>
        public static void SetSaneGender(this PKM pk, int gender)
        {
            int g = gender == -1 ? pk.GetSaneGender() : gender;

            pk.SetGender(g);
        }