mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-19 00:43:14 +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`
36 lines
868 B
C#
36 lines
868 B
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
public sealed class PokeBlock3Case
|
|
{
|
|
private const int Count = 40;
|
|
public readonly PokeBlock3[] Blocks;
|
|
|
|
public PokeBlock3Case(ReadOnlySpan<byte> data, int offset)
|
|
{
|
|
Blocks = new PokeBlock3[Count];
|
|
for (int i = 0; i < Blocks.Length; i++)
|
|
Blocks[i] = PokeBlock3.GetBlock(data, offset + (i * PokeBlock3.SIZE));
|
|
}
|
|
|
|
public byte[] Write()
|
|
{
|
|
byte[] result = new byte[Count*PokeBlock3.SIZE];
|
|
for (int i = 0; i < Blocks.Length; i++)
|
|
Blocks[i].SetBlock(result, i * PokeBlock3.SIZE);
|
|
return result;
|
|
}
|
|
|
|
public void DeleteAll()
|
|
{
|
|
foreach (var b in Blocks)
|
|
b.Delete();
|
|
}
|
|
|
|
public void MaximizeAll(bool createMissing = false)
|
|
{
|
|
foreach (var b in Blocks)
|
|
b.Maximize(createMissing);
|
|
}
|
|
}
|