2016-07-03 03:24:17 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
2017-01-08 07:54:09 +00:00
|
|
|
|
namespace PKHeX.Core
|
2016-07-03 03:24:17 +00:00
|
|
|
|
{
|
2017-10-24 06:12:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <see cref="PersonalInfo"/> class with values from the Black 2 & White 2 games.
|
|
|
|
|
/// </summary>
|
2016-07-03 03:24:17 +00:00
|
|
|
|
public class PersonalInfoB2W2 : PersonalInfoBW
|
|
|
|
|
{
|
2016-07-18 05:39:18 +00:00
|
|
|
|
public new const int SIZE = 0x4C;
|
2016-07-03 03:24:17 +00:00
|
|
|
|
public PersonalInfoB2W2(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
|
2017-06-18 01:37:19 +00:00
|
|
|
|
TMHM = GetBits(Data.Skip(0x28).Take(0x10).ToArray());
|
|
|
|
|
TypeTutors = GetBits(Data.Skip(0x38).Take(0x4).ToArray());
|
2016-07-03 03:24:17 +00:00
|
|
|
|
SpecialTutors = new[]
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
GetBits(Data.Skip(0x3C).Take(0x04).ToArray()),
|
|
|
|
|
GetBits(Data.Skip(0x40).Take(0x04).ToArray()),
|
|
|
|
|
GetBits(Data.Skip(0x44).Take(0x04).ToArray()),
|
|
|
|
|
GetBits(Data.Skip(0x48).Take(0x04).ToArray()),
|
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, 0x3C);
|
|
|
|
|
SetBits(SpecialTutors[1]).CopyTo(Data, 0x40);
|
|
|
|
|
SetBits(SpecialTutors[2]).CopyTo(Data, 0x44);
|
|
|
|
|
SetBits(SpecialTutors[3]).CopyTo(Data, 0x48);
|
2016-07-03 03:24:17 +00:00
|
|
|
|
return Data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|