mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 22:40:22 +00:00
0a8c791e10
Can have a single digit (not forced to 3), so null terminate I assume.
33 lines
No EOL
878 B
C#
33 lines
No EOL
878 B
C#
using System;
|
|
using System.Text;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
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);
|
|
}
|
|
|
|
public int TrainerID
|
|
{
|
|
get => BitConverter.ToInt32(Data, 0x1C);
|
|
set => SAV.SetData(Data, BitConverter.GetBytes(value), 0x1C);
|
|
}
|
|
|
|
public string Number
|
|
{
|
|
get => Encoding.ASCII.GetString(Data, 0x39, 3);
|
|
set
|
|
{
|
|
for (int i = 0; i < 3; i++)
|
|
Data[0x39 + i] = (byte) (value.Length > i ? value[i] : '\0');
|
|
SAV.Edited = true;
|
|
}
|
|
}
|
|
}
|
|
} |