2019-12-04 03:54:34 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
2019-11-26 07:26:01 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
2019-11-19 01:57:18 +00:00
|
|
|
|
{
|
|
|
|
|
public sealed class TrainerCard8 : SaveBlock
|
|
|
|
|
{
|
|
|
|
|
public TrainerCard8(SAV8SWSH sav, SCBlock block) : base (sav, block.Data) { }
|
|
|
|
|
|
|
|
|
|
public string OT
|
|
|
|
|
{
|
|
|
|
|
get => SAV.GetString(Data, 0x00, 0x1A);
|
|
|
|
|
set => SAV.SetData(Data, SAV.SetString(value, SAV.OTLength), 0x00);
|
|
|
|
|
}
|
2019-11-26 07:26:01 +00:00
|
|
|
|
|
2019-12-04 03:54:34 +00:00
|
|
|
|
public int TrainerID
|
|
|
|
|
{
|
|
|
|
|
get => BitConverter.ToInt32(Data, 0x1C);
|
2019-12-07 00:59:54 +00:00
|
|
|
|
set => SAV.SetData(Data, BitConverter.GetBytes(value), 0x1C);
|
2019-12-04 03:54:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-11-26 07:26:01 +00:00
|
|
|
|
public string Number
|
|
|
|
|
{
|
|
|
|
|
get => Encoding.ASCII.GetString(Data, 0x39, 3);
|
|
|
|
|
set
|
|
|
|
|
{
|
2019-11-26 18:45:36 +00:00
|
|
|
|
for (int i = 0; i < 3; i++)
|
2019-11-26 07:34:49 +00:00
|
|
|
|
Data[0x39 + i] = (byte) (value.Length > i ? value[i] : '0');
|
|
|
|
|
SAV.Edited = true;
|
2019-11-26 07:26:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-11-19 01:57:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|