mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Update Encount5.cs
This commit is contained in:
parent
9ef93552c9
commit
05364212ba
1 changed files with 5 additions and 12 deletions
|
@ -1,23 +1,16 @@
|
|||
using System;
|
||||
|
||||
namespace PKHeX.Core
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
public abstract class Encount5 : SaveBlock
|
||||
{
|
||||
protected Encount5(SAV5 SAV, int offset) : base(SAV) => Offset = offset;
|
||||
|
||||
public abstract uint SwarmSeed { get; set; }
|
||||
public abstract byte SwarmSeed { get; set; }
|
||||
public abstract uint SwarmMaxCountModulo { get; }
|
||||
|
||||
public uint SwarmIndex
|
||||
{
|
||||
get => SwarmSeed % SwarmMaxCountModulo;
|
||||
set
|
||||
{
|
||||
value %= SwarmMaxCountModulo;
|
||||
while (SwarmIndex != value)
|
||||
++SwarmSeed;
|
||||
}
|
||||
set => SwarmSeed = (byte)(value % SwarmMaxCountModulo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +18,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
public Encount5BW(SAV5BW SAV, int offset) : base(SAV, offset) { }
|
||||
|
||||
public override uint SwarmSeed { get => BitConverter.ToUInt32(Data, Offset + 0x30); set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x30); }
|
||||
public override byte SwarmSeed { get => Data[Offset + 0x30]; set => Data[Offset + 0x30] = value; }
|
||||
public override uint SwarmMaxCountModulo => 17;
|
||||
}
|
||||
|
||||
|
@ -33,7 +26,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
public Encount5B2W2(SAV5B2W2 SAV, int offset) : base(SAV, offset) { }
|
||||
|
||||
public override uint SwarmSeed { get => BitConverter.ToUInt32(Data, Offset + 0x2C); set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x2C); }
|
||||
public override byte SwarmSeed { get => Data[Offset + 0x2C]; set => Data[Offset + 0x2C] = value; }
|
||||
public override uint SwarmMaxCountModulo => 19;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue