mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Add DisplayTID/SID getset
This commit is contained in:
parent
08835d5d97
commit
dc813da2f7
1 changed files with 22 additions and 2 deletions
|
@ -413,8 +413,6 @@ namespace PKHeX.Core
|
|||
public virtual int Game { get => -1; set { } }
|
||||
public virtual int TID { get; set; }
|
||||
public virtual int SID { get; set; }
|
||||
public int TrainerID7 => (int)((uint)(TID | (SID << 16)) % 1000000);
|
||||
public int TrainerSID7 => (int)((uint)(TID | (SID << 16)) / 1000000);
|
||||
public virtual string OT { get; set; } = "PKHeX";
|
||||
public virtual int PlayedHours { get; set; }
|
||||
public virtual int PlayedMinutes { get; set; }
|
||||
|
@ -427,6 +425,28 @@ namespace PKHeX.Core
|
|||
public virtual int PartyCount { get; protected set; }
|
||||
public virtual int MultiplayerSpriteID { get => 0; set { } }
|
||||
|
||||
public int TrainerID7 { get => (int)((uint)(TID | (SID << 16)) % 1000000); set => SetID7(TrainerSID7, value); }
|
||||
public int TrainerSID7 { get => (int)((uint)(TID | (SID << 16)) / 1000000); set => SetID7(value, TrainerID7); }
|
||||
|
||||
public int DisplayTID
|
||||
{
|
||||
get => Generation >= 7 ? TrainerID7 : TID;
|
||||
set { if (Generation >= 7) TrainerID7 = value; else TID = value; }
|
||||
}
|
||||
|
||||
public int DisplaySID
|
||||
{
|
||||
get => Generation >= 7 ? TrainerSID7 : SID;
|
||||
set { if (Generation >= 7) TrainerSID7 = value; else SID = value; }
|
||||
}
|
||||
|
||||
private void SetID7(int sid7, int tid7)
|
||||
{
|
||||
var oid = (sid7 * 1_000_000) + (tid7 % 1_000_000);
|
||||
TID = (ushort)oid;
|
||||
SID = oid >> 16;
|
||||
}
|
||||
|
||||
public bool IsPartyAllEggs(params int[] except)
|
||||
{
|
||||
if (!HasParty)
|
||||
|
|
Loading…
Reference in a new issue