PKHeX/PKHeX.Core/Saves/Substructures/Gen5/Encount5.cs

33 lines
1 KiB
C#
Raw Normal View History

2021-08-21 03:53:23 +00:00
namespace PKHeX.Core
{
public abstract class Encount5 : SaveBlock
{
protected Encount5(SAV5 SAV, int offset) : base(SAV) => Offset = offset;
2021-08-21 03:53:23 +00:00
public abstract byte SwarmSeed { get; set; }
public abstract uint SwarmMaxCountModulo { get; }
public uint SwarmIndex
{
get => SwarmSeed % SwarmMaxCountModulo;
2021-08-21 03:53:23 +00:00
set => SwarmSeed = (byte)(value % SwarmMaxCountModulo);
}
}
public sealed class Encount5BW : Encount5
{
public Encount5BW(SAV5BW SAV, int offset) : base(SAV, offset) { }
2021-08-21 03:53:23 +00:00
public override byte SwarmSeed { get => Data[Offset + 0x30]; set => Data[Offset + 0x30] = value; }
public override uint SwarmMaxCountModulo => 17;
}
public sealed class Encount5B2W2 : Encount5
{
public Encount5B2W2(SAV5B2W2 SAV, int offset) : base(SAV, offset) { }
2021-08-21 03:53:23 +00:00
public override byte SwarmSeed { get => Data[Offset + 0x2C]; set => Data[Offset + 0x2C] = value; }
public override uint SwarmMaxCountModulo => 19;
}
}