2023-01-22 04:02:33 +00:00
|
|
|
using System;
|
2022-01-03 05:35:59 +00:00
|
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
2020-12-29 19:39:19 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
2024-03-04 05:13:16 +00:00
|
|
|
public sealed class FieldMenu7(SAV7 sav, Memory<byte> raw) : SaveBlock<SAV7>(sav, raw)
|
2019-06-09 02:56:11 +00:00
|
|
|
{
|
2023-12-04 04:13:20 +00:00
|
|
|
// US/UM ONLY
|
2022-06-18 18:04:24 +00:00
|
|
|
public ushort RotomAffection
|
|
|
|
{
|
2024-03-04 05:13:16 +00:00
|
|
|
get => ReadUInt16LittleEndian(Data[0x1A..]);
|
|
|
|
set => WriteUInt16LittleEndian(Data[0x1A..], Math.Min((ushort)1000, value));
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|
2020-12-29 19:39:19 +00:00
|
|
|
|
2024-03-04 05:13:16 +00:00
|
|
|
public bool RotomLoto1 { get => (Data[0x2A] & 1) == 1; set => Data[0x2A] = (byte)((Data[0x2A] & ~1) | (value ? 1 : 0)); }
|
|
|
|
public bool RotomLoto2 { get => (Data[0x2A] & 2) == 2; set => Data[0x2A] = (byte)((Data[0x2A] & ~2) | (value ? 2 : 0)); }
|
2020-12-29 19:39:19 +00:00
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
public string RotomOT
|
|
|
|
{
|
2023-03-26 06:14:50 +00:00
|
|
|
get => SAV.GetString(RotomNameSpan);
|
|
|
|
set => SAV.SetString(RotomNameSpan, value, SAV.MaxStringLengthOT, StringConverterOption.ClearZero);
|
2019-06-09 02:56:11 +00:00
|
|
|
}
|
2023-03-26 06:14:50 +00:00
|
|
|
|
2024-03-04 05:13:16 +00:00
|
|
|
private Span<byte> RotomNameSpan => Data.Slice(0x30, 0x1A);
|
2022-06-18 18:04:24 +00:00
|
|
|
}
|