NHSE/NHSE.Core/Save/Offsets/Personal30.cs
Kurt 2db5456251 Handle uninitialized 3.0.0 updated saves
get the game to update the save file, but without re-saving in-game, will be uninitialized (bad Hotel Tickets parsing).
2026-01-16 15:42:48 -06:00

32 lines
774 B
C#

using System;
namespace NHSE.Core;
public sealed class Personal30(Memory<byte> raw)
{
public Span<byte> Data => raw.Span;
public bool IsInitialized30 => System.Buffers.Binary.BinaryPrimitives.ReadInt64LittleEndian(raw.Span) != 0;
public EncryptedInt32 HotelTickets // @0x0 size 0x8, align 4
{
get => EncryptedInt32.ReadVerify(Data, 0);
set => value.Write(Data);
}
}
public interface IPersonal30
{
public int Offset30s_064c1881 { get; }
public int Length30s_064c1881 { get; }
}
public static class Personal30Extensions
{
extension(IPersonal30 personal)
{
public Personal30 Get30s_064c1881(Memory<byte> data)
=> new(data.Slice(personal.Offset30s_064c1881, personal.Length30s_064c1881));
}
}