mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
3c232505e5
In this pull request I've changed a ton of method signatures to reflect the more-narrow types of Species, Move# and Form; additionally, I've narrowed other large collections that stored lists of species / permitted values, and reworked them to be more performant with the latest API spaghetti that PKHeX provides. Roamer met locations, usually in a range of [max-min]<64, can be quickly checked using a bitflag operation on a UInt64. Other collections (like "Is this from Colosseum or XD") were eliminated -- shadow state is not transferred COLO<->XD, so having a Shadow ID or matching the met location from a gift/wild encounter is a sufficient check for "originated in XD".
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
namespace PKHeX.Core;
|
|
|
|
public abstract class MailDetail
|
|
{
|
|
protected readonly byte[] Data;
|
|
protected readonly int DataOffset;
|
|
|
|
protected MailDetail(byte[] data, int offset = 0)
|
|
{
|
|
Data = data;
|
|
DataOffset = offset;
|
|
}
|
|
|
|
public virtual void CopyTo(SaveFile sav) => sav.SetData(Data, DataOffset);
|
|
public virtual void CopyTo(PK4 pk4) { }
|
|
public virtual void CopyTo(PK5 pk5) { }
|
|
public virtual string GetMessage(bool isLastLine) => string.Empty;
|
|
public virtual ushort GetMessage(int index1, int index2) => 0;
|
|
public virtual void SetMessage(string line1, string line2) { }
|
|
public virtual void SetMessage(int index1, int index2, ushort value) { }
|
|
public virtual string AuthorName { get; set; } = string.Empty;
|
|
public virtual ushort AuthorTID { get; set; }
|
|
public virtual ushort AuthorSID { get; set; }
|
|
public virtual byte AuthorVersion { get; set; }
|
|
public virtual byte AuthorLanguage { get; set; }
|
|
public virtual byte AuthorGender { get; set; }
|
|
public virtual ushort AppearPKM { get; set; }
|
|
public virtual int MailType { get; set; }
|
|
public abstract bool? IsEmpty { get; } // true: empty, false: legal mail, null: illegal mail
|
|
public virtual void SetBlank() { }
|
|
}
|