mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-28 06:50:23 +00:00
31 lines
No EOL
895 B
C#
31 lines
No EOL
895 B
C#
namespace PKHeX.Core
|
|
{
|
|
public sealed class BoxLayout8 : SaveBlock
|
|
{
|
|
public const int BoxCount = 32;
|
|
|
|
private const int strlen = SAV6.LongStringLength / 2;
|
|
|
|
public BoxLayout8(SAV8SWSH sav, SCBlock block) : base(sav, block.Data) { }
|
|
|
|
private int GetBoxNameOffset(int box) => SAV6.LongStringLength * box;
|
|
|
|
public string GetBoxName(int box)
|
|
{
|
|
return SAV.GetString(Data, GetBoxNameOffset(box), SAV6.LongStringLength);
|
|
}
|
|
|
|
public void SetBoxName(int box, string value)
|
|
{
|
|
var data = SAV.SetString(value, strlen, strlen, 0);
|
|
var offset = GetBoxNameOffset(box) + (SAV6.LongStringLength * box);
|
|
SAV.SetData(Data, data, offset);
|
|
}
|
|
|
|
public string this[int i]
|
|
{
|
|
get => GetBoxName(i);
|
|
set => SetBoxName(i, value);
|
|
}
|
|
}
|
|
} |