Misc perf tweaks

checking untraded should just check for the first character (rather than
creating string object)
hashset for wild6 balls
This commit is contained in:
Kurt 2017-12-13 16:12:53 -08:00
parent 816ebf6b0e
commit a9ff74059a
4 changed files with 5 additions and 3 deletions

View file

@ -266,7 +266,7 @@ namespace PKHeX.Core
098, 224, 400, 515, 008, 130, 195, 419, 061, 184, 657
};
internal static readonly int[] CosplayPikachuMoves = { 309, 556, 577, 604, 560, 0 };
internal static readonly int[] WildPokeballs6 = { 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
internal static readonly HashSet<int> WildPokeballs6 = new HashSet<int> {0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
internal static readonly HashSet<int> Ban_NoHidden6 = new HashSet<int>
{

View file

@ -372,6 +372,7 @@ namespace PKHeX.Core
public override int PSV => (int)((PID >> 16 ^ PID & 0xFFFF) >> 4);
public override int TSV => (TID ^ SID) >> 4;
public bool IsUntradedEvent6 => Geo1_Country == 0 && Geo1_Region == 0 && Met_Location / 10000 == 4 && Gen6;
public override bool IsUntraded => Data[0x78] == 0 && Data[0x78 + 1] == 0 && Format == GenNumber; // immediately terminated HT_Name data (\0)
// Complex Generated Attributes

View file

@ -403,7 +403,8 @@ namespace PKHeX.Core
public override int PSV => (int)((PID >> 16 ^ PID & 0xFFFF) >> 4);
public override int TSV => (TID ^ SID) >> 4;
public bool IsUntradedEvent6 => Geo1_Country == 0 && Geo1_Region == 0 && Met_Location / 10000 == 4 && Gen6;
public override bool IsUntraded => Data[0x78] == 0 && Data[0x78 + 1] == 0 && Format == GenNumber; // immediately terminated HT_Name data (\0)
// Complex Generated Attributes
public override int Characteristic
{

View file

@ -514,7 +514,7 @@ namespace PKHeX.Core
}
}
public virtual bool WasIngameTrade => Met_Location == 30001 || Gen4 && Egg_Location == 2001;
public virtual bool IsUntraded => Format >= 6 && string.IsNullOrWhiteSpace(HT_Name) && GenNumber == Format;
public virtual bool IsUntraded => false;
public virtual bool IsNative => GenNumber == Format;
public virtual bool IsOriginValid => Species <= Legal.GetMaxSpeciesOrigin(Format);