mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-23 17:56:08 -05:00
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com> Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com> Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
25 lines
851 B
C#
25 lines
851 B
C#
using System;
|
||
using System.ComponentModel;
|
||
using static System.Buffers.Binary.BinaryPrimitives;
|
||
|
||
namespace PKHeX.Core;
|
||
|
||
/// <summary>
|
||
/// Stores the amount of time the save file has been played.
|
||
/// </summary>
|
||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||
public sealed class PlayTime8a : SaveBlock
|
||
{
|
||
public PlayTime8a(SAV8LA sav, SCBlock block) : base(sav, block.Data) { }
|
||
|
||
public ushort PlayedHours
|
||
{
|
||
get => ReadUInt16LittleEndian(Data.AsSpan(Offset));
|
||
set => WriteUInt16LittleEndian(Data.AsSpan(Offset), value);
|
||
}
|
||
|
||
public byte PlayedMinutes { get => Data[Offset + 2]; set => Data[Offset + 2] = value; }
|
||
public byte PlayedSeconds { get => Data[Offset + 3]; set => Data[Offset + 3] = value; }
|
||
public string LastSavedTime => $"{PlayedHours:0000}ː{PlayedMinutes:00}ː{PlayedSeconds:00}"; // not :
|
||
}
|