PKHeX/PKHeX.Core/Saves/Substructures/Gen9/PlayTime9.cs
Kurt 03182ebd3d Update 22.11.24
Adds support for Scarlet & Violet.

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-11-24 17:42:17 -08:00

27 lines
763 B
C#

using System;
using static System.Buffers.Binary.BinaryPrimitives;
namespace PKHeX.Core;
public sealed class PlayTime9 : SaveBlock<SAV9SV>
{
public PlayTime9(SAV9SV sav, SCBlock block) : base(sav, block.Data) { }
public int PlayedHours
{
get => ReadInt32LittleEndian(Data.AsSpan(Offset));
set => WriteInt32LittleEndian(Data.AsSpan(Offset), (ushort)value);
}
public int PlayedMinutes
{
get => ReadInt32LittleEndian(Data.AsSpan(Offset + 4));
set => WriteInt32LittleEndian(Data.AsSpan(Offset + 4), (ushort)value);
}
public int PlayedSeconds
{
get => ReadInt32LittleEndian(Data.AsSpan(Offset + 8));
set => WriteInt32LittleEndian(Data.AsSpan(Offset + 8), (ushort)value);
}
}