/// <summary> /// Sets the <see cref="PKM.IVs"/> to match a provided <see cref="hiddenPowerType"/>. /// </summary> /// <param name="pk">Pokémon to modify.</param> /// <param name="hiddenPowerType">Desired Hidden Power typing.</param> public static void SetHiddenPower(this PKM pk, int hiddenPowerType) { var IVs = pk.IVs; HiddenPower.SetIVsForType(hiddenPowerType, IVs, pk.Format); pk.IVs = IVs; }
/// <summary> /// Sets the <see cref="PKM.IVs"/> to match a provided <see cref="hiddenPowerType"/>. /// </summary> /// <param name="pk">Pokémon to modify.</param> /// <param name="hiddenPowerType">Desired Hidden Power typing.</param> public static void SetHiddenPower(this PKM pk, int hiddenPowerType) { Span <int> IVs = stackalloc int[6]; pk.GetIVs(IVs); HiddenPower.SetIVsForType(hiddenPowerType, IVs, pk.Format); pk.SetIVs(IVs); }
/// <summary>Compares two HiddenPower instances to determine value equality.</summary> /// <remarks> /// Two instances are determined to be equal if their type and base power are equal. /// </remarks> /// <param name="rhs">HiddenPower with which to compare self</param> /// <returns>Whether or not HiddenPower instances are equal</returns> public bool Equals(HiddenPower rhs) { if (rhs == null) { return(false); } else if (this == rhs) { return(true); } else { return(this.Type.Equals(rhs.Type) && this.BasePower == rhs.BasePower); } }
/// <summary>Compares a HiddenPower to a C# object.</summary> /// <param name="rhs">Object with which to compare self</param> /// <returns>Whether or not HiddenPower and Object are equal</returns> public override bool Equals(System.Object rhs) { if (rhs == null) { return(false); } HiddenPower rhsHiddenPower = rhs as HiddenPower; if (rhsHiddenPower == null) { return(false); } else { return(this.Equals(rhsHiddenPower)); } }
public String GetHiddenPowerType() { switch (HiddenPower.GetType(IVs)) { case 0: return("Fighting"); case 1: return("Flying"); case 2: return("Poison"); case 3: return("Ground"); case 4: return("Rock"); case 5: return("Bug"); case 6: return("Ghost"); case 7: return("Steel"); case 8: return("Fire"); case 9: return("Water"); case 10: return("Grass"); case 11: return("Electric"); case 12: return("Psychic"); case 13: return("Ice"); case 14: return("Dragon"); case 15: return("Dark"); } return(string.Empty); }