mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-25 03:43:16 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
namespace PKHeX.Core;
|
|
|
|
public sealed class Daycare7 : SaveBlock<SAV7>
|
|
{
|
|
public const int DaycareSeedSize = 32; // 128 bits
|
|
|
|
public Daycare7(SAV7SM sav, int offset) : base(sav) => Offset = offset;
|
|
public Daycare7(SAV7USUM sav, int offset) : base(sav) => Offset = offset;
|
|
|
|
public bool GetIsOccupied(int slot)
|
|
{
|
|
return Data[Offset + ((PokeCrypto.SIZE_6STORED + 1) * slot)] != 0;
|
|
}
|
|
|
|
public void SetOccupied(int slot, bool occupied)
|
|
{
|
|
Data[Offset + ((PokeCrypto.SIZE_6STORED + 1) * slot)] = occupied ? (byte)1 : (byte)0;
|
|
}
|
|
|
|
public int GetDaycareSlotOffset(int slot)
|
|
{
|
|
return Offset + 1 + (slot * (PokeCrypto.SIZE_6STORED + 1));
|
|
}
|
|
|
|
public bool HasEgg
|
|
{
|
|
get => Data[Offset + 0x1D8] == 1;
|
|
set => Data[Offset + 0x1D8] = value ? (byte)1 : (byte)0;
|
|
}
|
|
|
|
public string RNGSeed
|
|
{
|
|
get => Util.GetHexStringFromBytes(Data, Offset + 0x1DC, DaycareSeedSize / 2);
|
|
set
|
|
{
|
|
if (value.Length != DaycareSeedSize)
|
|
return;
|
|
|
|
var data = Util.GetBytesFromHexString(value);
|
|
SAV.SetData(data, Offset + 0x1DC);
|
|
}
|
|
}
|
|
}
|