mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Minor tweaks
make some enums non-int (in favor of byte etc) return current nickname if desired clamp nature top bound too
This commit is contained in:
parent
5879cc8a18
commit
a9152d36a4
6 changed files with 12 additions and 9 deletions
|
@ -33,12 +33,14 @@ namespace PKHeX.Core
|
|||
/// Clears the <see cref="PKM.Nickname"/> to the default value.
|
||||
/// </summary>
|
||||
/// <param name="pk"></param>
|
||||
public static void ClearNickname(this PKM pk)
|
||||
public static string ClearNickname(this PKM pk)
|
||||
{
|
||||
pk.IsNicknamed = false;
|
||||
pk.Nickname = PKX.GetSpeciesNameGeneration(pk.Species, pk.Language, pk.Format);
|
||||
string nick = PKX.GetSpeciesNameGeneration(pk.Species, pk.Language, pk.Format);
|
||||
pk.Nickname = nick;
|
||||
if (pk is _K12 pk12)
|
||||
pk12.SetNotNicknamed();
|
||||
return nick;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -158,10 +160,11 @@ namespace PKHeX.Core
|
|||
/// <param name="nature">Desired <see cref="PKM.Nature"/> value to set.</param>
|
||||
public static void SetNature(this PKM pk, int nature)
|
||||
{
|
||||
var value = Math.Min((int)Nature.Quirky, Math.Max((int)Nature.Hardy, nature));
|
||||
if (pk.Format <= 4)
|
||||
pk.SetPIDNature(Math.Max(0, nature));
|
||||
pk.SetPIDNature(value);
|
||||
else
|
||||
pk.Nature = Math.Max(0, nature);
|
||||
pk.Nature = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace PKHeX.Core
|
|||
/// <summary>
|
||||
/// Ball IDs for the corresponding English ball name.
|
||||
/// </summary>
|
||||
public enum Ball
|
||||
public enum Ball : byte
|
||||
{
|
||||
None = 0,
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/// <summary>
|
||||
/// <see cref="GameVersion"/> analogues used by Colosseum/XD instead of the main-series values.
|
||||
/// </summary>
|
||||
public enum GCVersion
|
||||
public enum GCVersion : byte
|
||||
{
|
||||
None = 0,
|
||||
FR = 1,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace PKHeX.Core
|
||||
{
|
||||
public enum MemoryArgType
|
||||
public enum MemoryArgType : byte
|
||||
{
|
||||
None,
|
||||
GeneralLocation,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/// <summary>
|
||||
/// Elemental type a move has; additionally, types a <see cref="PKM"/> can have.
|
||||
/// </summary>
|
||||
public enum MoveType
|
||||
public enum MoveType : sbyte
|
||||
{
|
||||
Any = -1,
|
||||
Normal,
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace PKHeX.Core
|
|||
/// <summary>
|
||||
/// Indicates the Availability of the Generation 2 Headbutt Tree
|
||||
/// </summary>
|
||||
public enum TreeEncounterAvailable
|
||||
public enum TreeEncounterAvailable : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Encounter is possible a reachable tree
|
||||
|
|
Loading…
Reference in a new issue