mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-17 16:03:10 +00:00
8d8adde2b1
sealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealed
29 lines
No EOL
989 B
C#
29 lines
No EOL
989 B
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public sealed class PWTBlock5 : SaveBlock
|
|
{
|
|
public PWTBlock5(SAV5B2W2 sav, int offset) : base(sav) => Offset = offset;
|
|
|
|
public ushort GetPWTRecord(int id) => GetPWTRecord((PWTRecordID)id);
|
|
|
|
public ushort GetPWTRecord(PWTRecordID id)
|
|
{
|
|
if (id < PWTRecordID.Normal || id > PWTRecordID.MixMaster)
|
|
throw new ArgumentException(nameof(id));
|
|
int ofs = Offset + 0x5C + ((int)id * 2);
|
|
return BitConverter.ToUInt16(Data, ofs);
|
|
}
|
|
|
|
public void SetPWTRecord(int id, ushort value) => SetPWTRecord((PWTRecordID)id, value);
|
|
|
|
public void SetPWTRecord(PWTRecordID id, ushort value)
|
|
{
|
|
if (id < PWTRecordID.Normal || id > PWTRecordID.MixMaster)
|
|
throw new ArgumentException(nameof(id));
|
|
int ofs = Offset + 0x5C + ((int)id * 2);
|
|
SAV.SetData(BitConverter.GetBytes(value), ofs);
|
|
}
|
|
}
|
|
} |