mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-11 15:07:11 +00:00
f4bfdb8311
yay net 4.6 read more: http://justinvp.com/2015/07/20/array-empty/
33 lines
912 B
C#
33 lines
912 B
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// <see cref="PersonalInfo"/> class with values from Generation 4 games.
|
|
/// </summary>
|
|
public class PersonalInfoG4 : PersonalInfoG3
|
|
{
|
|
public new const int SIZE = 0x2C;
|
|
|
|
public PersonalInfoG4(byte[] data)
|
|
{
|
|
if (data.Length != SIZE)
|
|
return;
|
|
Data = data;
|
|
|
|
// Unpack TMHM & Tutors
|
|
TMHM = GetBits(Data, 0x1C, 0x0D);
|
|
TypeTutors = Array.Empty<bool>(); // not stored in personal
|
|
}
|
|
|
|
public override byte[] Write()
|
|
{
|
|
SetBits(TMHM).CopyTo(Data, 0x1C);
|
|
return Data;
|
|
}
|
|
|
|
// Manually added attributes
|
|
public override int FormeCount { get => Data[0x29]; set {} }
|
|
protected internal override int FormStatsIndex { get => BitConverter.ToUInt16(Data, 0x2A); set {} }
|
|
}
|
|
}
|