Moved a bunch of common fields over to GtsRecordBase.

This commit is contained in:
Greg Edwards
2015-04-20 21:11:56 -04:00
parent 8d8d0e44cc
commit a49b764bc0
3 changed files with 45 additions and 87 deletions

View File

@@ -52,42 +52,9 @@ namespace PkmnFoundations.Structures
/// </summary>
public byte[] Data;
/// <summary>
/// National Dex species number
/// </summary>
public ushort Species;
/// <summary>
/// Pokémon gender
/// </summary>
public Genders Gender;
/// <summary>
/// Pokémon level
/// </summary>
public byte Level;
/// <summary>
/// Requested National Dex species number
/// </summary>
public ushort RequestedSpecies;
public Genders RequestedGender;
public byte RequestedMinLevel;
public byte RequestedMaxLevel;
public byte Unknown1;
public TrainerGenders TrainerGender;
public byte Unknown2;
public DateTime ? TimeDeposited;
public DateTime ? TimeExchanged;
/// <summary>
/// User ID of the player (not Personality Value)
/// </summary>
public int PID;
/// <summary>
/// 16 bytes
/// </summary>
@@ -95,15 +62,6 @@ namespace PkmnFoundations.Structures
public ushort TrainerOT;
public byte TrainerCountry;
public byte TrainerRegion;
public byte TrainerClass;
public byte IsExchanged;
public byte TrainerVersion;
public byte TrainerLanguage;
protected override void Save(BinaryWriter writer)
{
// todo: enclose in properties and validate these when assigning.

View File

@@ -47,49 +47,14 @@ namespace PkmnFoundations.Structures
}
// xxx: Data and Unknown0 should be one field.
/// <summary>
/// Obfuscated Pokémon (pkm) data. 220 bytes
/// Obfuscated Pokémon (pkm) data. 236 bytes
/// </summary>
public byte[] Data;
/// <summary>
/// National Dex species number
/// </summary>
public ushort Species;
/// <summary>
/// Pokémon gender
/// </summary>
public Genders Gender;
/// <summary>
/// Pokémon level
/// </summary>
public byte Level;
/// <summary>
/// Requested National Dex species number
/// </summary>
public ushort RequestedSpecies;
public Genders RequestedGender;
public byte RequestedMinLevel;
public byte RequestedMaxLevel;
public byte Unknown1;
public TrainerGenders TrainerGender;
public byte Unknown2;
public DateTime ? TimeDeposited;
public DateTime ? TimeExchanged;
/// <summary>
/// User ID of the player (not Personality Value)
/// </summary>
public int PID;
public uint TrainerOT;
/// <summary>
@@ -97,15 +62,6 @@ namespace PkmnFoundations.Structures
/// </summary>
public EncodedString5 TrainerName;
public byte TrainerCountry;
public byte TrainerRegion;
public byte TrainerClass;
public byte IsExchanged;
public byte TrainerVersion;
public byte TrainerLanguage;
public byte TrainerBadges; // speculative. Usually 8.
public byte TrainerUnityTower;

View File

@@ -25,6 +25,50 @@ namespace PkmnFoundations.Structures
}
}
/// <summary>
/// National Dex species number
/// </summary>
public ushort Species;
/// <summary>
/// Pokémon gender
/// </summary>
public Genders Gender;
/// <summary>
/// Pokémon level
/// </summary>
public byte Level;
/// <summary>
/// Requested National Dex species number
/// </summary>
public ushort RequestedSpecies;
public Genders RequestedGender;
public byte RequestedMinLevel;
public byte RequestedMaxLevel;
public TrainerGenders TrainerGender;
public DateTime? TimeDeposited;
public DateTime? TimeExchanged;
/// <summary>
/// User ID of the player (not Personality Value)
/// </summary>
public int PID;
public byte TrainerCountry;
public byte TrainerRegion;
public byte TrainerClass;
public byte IsExchanged;
public byte TrainerVersion;
public byte TrainerLanguage;
public static bool CheckLevels(byte min, byte max, byte other)
{
if (max == 0) max = 255;