mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
d47bb1d297
With the new version of Visual Studio bringing C# 12, we can revise our logic for better readability as well as use new methods/APIs introduced in the .NET 8.0 BCL.
15 lines
558 B
C#
15 lines
558 B
C#
using System;
|
|
using static System.Buffers.Binary.BinaryPrimitives;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
public sealed class RTC3(byte[] Data)
|
|
{
|
|
public readonly byte[] Data = Data;
|
|
public const int Size = 8;
|
|
|
|
public int Day { get => ReadUInt16LittleEndian(Data.AsSpan(0x00)); set => WriteUInt16LittleEndian(Data.AsSpan(0x00), (ushort)value); }
|
|
public int Hour { get => Data[2]; set => Data[2] = (byte)value; }
|
|
public int Minute { get => Data[3]; set => Data[3] = (byte)value; }
|
|
public int Second { get => Data[4]; set => Data[4] = (byte)value; }
|
|
}
|