2016-07-28 01:08:08 +00:00
|
|
|
|
using System;
|
2016-07-03 03:24:17 +00:00
|
|
|
|
|
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 Generation 4 games.
|
|
|
|
|
/// </summary>
|
2016-07-03 20:41:50 +00:00
|
|
|
|
public class PersonalInfoG4 : PersonalInfoG3
|
2016-07-03 03:24:17 +00:00
|
|
|
|
{
|
2016-07-18 05:39:18 +00:00
|
|
|
|
public new const int SIZE = 0x2C;
|
2018-07-27 02:34:27 +00:00
|
|
|
|
|
2016-07-03 03:24:17 +00:00
|
|
|
|
public PersonalInfoG4(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, 0x1C, 0x0D);
|
2018-08-02 01:30:51 +00:00
|
|
|
|
TypeTutors = Array.Empty<bool>(); // not stored in personal
|
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-11-29 07:14:08 +00:00
|
|
|
|
SetBits(TMHM).CopyTo(Data, 0x1C);
|
2016-07-03 03:24:17 +00:00
|
|
|
|
return Data;
|
|
|
|
|
}
|
2016-07-28 01:08:08 +00:00
|
|
|
|
|
|
|
|
|
// Manually added attributes
|
2017-05-13 03:32:36 +00:00
|
|
|
|
public override int FormeCount { get => Data[0x29]; set {} }
|
|
|
|
|
protected internal override int FormStatsIndex { get => BitConverter.ToUInt16(Data, 0x2A); set {} }
|
2016-07-03 03:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|