Add LGPE Adventure Begin Date (#4189)

This commit is contained in:
Jonathan Herbert
2024-02-23 15:19:01 -04:00
committed by GitHub
parent 95fbf66a6e
commit cf274bba70
4 changed files with 15 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
namespace PKHeX.Core;
namespace PKHeX.Core;
/// <summary>
/// Interface for Accessing named blocks within a Generation 7 LGP/E save file.
@@ -16,4 +16,5 @@ public interface ISaveBlock7b
PokeListHeader Storage { get; }
WB7Records GiftRecords { get; }
CaptureRecords Captured { get; }
PlayerGeoLocation7b PlayerGeoLocation { get; }
}

View File

@@ -51,6 +51,7 @@ public SaveBlockAccessor7b(SAV7b sav)
Captured = new CaptureRecords(sav, GetBlockOffset(BelugaBlockIndex.CaptureRecord));
FashionPlayer = new Fashion7b(sav, GetBlockOffset(BelugaBlockIndex.FashionPlayer));
FashionStarter = new Fashion7b(sav, GetBlockOffset(BelugaBlockIndex.FashionStarter));
PlayerGeoLocation = new PlayerGeoLocation7b(sav, GetBlockOffset(BelugaBlockIndex.PlayerGeoLocation));
}
public MyItem Items { get; }
@@ -66,6 +67,7 @@ public SaveBlockAccessor7b(SAV7b sav)
public CaptureRecords Captured { get; }
public Fashion7b FashionPlayer { get; }
public Fashion7b FashionStarter { get; }
public PlayerGeoLocation7b PlayerGeoLocation { get; }
public BlockInfo GetBlock(BelugaBlockIndex index) => BlockInfo[(int)index];
public int GetBlockOffset(BelugaBlockIndex index) => GetBlock(index).Offset;
}

View File

@@ -61,6 +61,7 @@ private void Initialize()
public PokeListHeader Storage => Blocks.Storage;
public WB7Records GiftRecords => Blocks.GiftRecords;
public CaptureRecords Captured => Blocks.Captured;
public PlayerGeoLocation7b PlayerGeoLocation => Blocks.PlayerGeoLocation;
public override IReadOnlyList<InventoryPouch> Inventory { get => Blocks.Items.Inventory; set => Blocks.Items.Inventory = value; }

View File

@@ -0,0 +1,10 @@
using System;
namespace PKHeX.Core;
public sealed class PlayerGeoLocation7b : SaveBlock<SAV7b>
{
public PlayerGeoLocation7b(SAV7b sav, int offset) : base(sav) => Offset = offset;
public Epoch1970Value AdventureBegin => new(Data.AsMemory(Offset + 0x48));
}