2018-02-17 03:34:42 +00:00
|
|
|
|
namespace PKHeX.Core
|
2016-07-03 03:24:17 +00:00
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
2018-07-22 02:20:11 +00:00
|
|
|
|
/// <see cref="PersonalInfo"/> class with values from the OR & AS games.
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// </summary>
|
2016-07-03 03:24:17 +00:00
|
|
|
|
public class PersonalInfoORAS : PersonalInfoXY
|
|
|
|
|
{
|
2016-07-18 05:39:18 +00:00
|
|
|
|
public new const int SIZE = 0x50;
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2016-07-03 03:24:17 +00:00
|
|
|
|
public PersonalInfoORAS(byte[] data)
|
|
|
|
|
{
|
2016-07-18 05:39:18 +00:00
|
|
|
|
if (data.Length != SIZE)
|
2016-07-03 03:24:17 +00:00
|
|
|
|
return;
|
|
|
|
|
Data = data;
|
|
|
|
|
|
|
|
|
|
// Unpack TMHM & Tutors
|
2018-02-17 03:34:42 +00:00
|
|
|
|
TMHM = GetBits(Data, 0x28, 0x10);
|
|
|
|
|
TypeTutors = GetBits(Data, 0x38, 0x4);
|
2016-07-03 03:24:17 +00:00
|
|
|
|
// 0x3C-0x40 unknown
|
|
|
|
|
SpecialTutors = new[]
|
|
|
|
|
{
|
2018-02-17 03:34:42 +00:00
|
|
|
|
GetBits(Data, 0x40, 0x04),
|
|
|
|
|
GetBits(Data, 0x44, 0x04),
|
|
|
|
|
GetBits(Data, 0x48, 0x04),
|
|
|
|
|
GetBits(Data, 0x4C, 0x04),
|
2016-07-03 03:24:17 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2016-07-03 03:24:17 +00:00
|
|
|
|
public override byte[] Write()
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SetBits(TMHM).CopyTo(Data, 0x28);
|
|
|
|
|
SetBits(TypeTutors).CopyTo(Data, 0x38);
|
|
|
|
|
SetBits(SpecialTutors[0]).CopyTo(Data, 0x40);
|
|
|
|
|
SetBits(SpecialTutors[1]).CopyTo(Data, 0x44);
|
|
|
|
|
SetBits(SpecialTutors[2]).CopyTo(Data, 0x48);
|
|
|
|
|
SetBits(SpecialTutors[3]).CopyTo(Data, 0x4C);
|
2016-07-03 03:24:17 +00:00
|
|
|
|
return Data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|