diff --git a/.jules/scribe.md b/.jules/scribe.md index 5c64f07..276acfa 100644 --- a/.jules/scribe.md +++ b/.jules/scribe.md @@ -9,3 +9,4 @@ ## 2026-07-15 - [ProductPatterns] Learning: Multi-region memory support is implemented via a central registry that maps regional identifiers (Global, China, Korea) to product-specific pattern dictionaries. Action: When documenting pattern-related types, clarify that these strings are raw signatures used by the assembly loader to resolve memory offsets across different game versions. ## 2026-06-24 - [RemoteAgents] Learning: "Dawn" is the internal game name for the Duty Support and Trust systems. Action: When documenting "Dawn" related agents or offsets, explicitly reference both Duty Support and Trust to ensure clarity for developers familiar with the in-game terminology. ## 2026-06-25 - [AetherialWheel] Learning: FC Aetherial Wheel data includes multiple item IDs (Starting, Current, Resulting) to track the transformation of a wheel as it primes. Action: When documenting aetherial wheel structures, distinguish between the unprimed source item and the final primed result to clarify the priming lifecycle. +## 2026-07-20 - [AgentHousing] Learning: Housing ward and plot numbers are stored as 0-based values in memory but are presented as 1-based values in the game UI and library properties. Action: Always clarify the 1-based vs 0-based nature of housing indices in documentation to prevent off-by-one errors in profile logic. diff --git a/RemoteAgents/AgentHousing.cs b/RemoteAgents/AgentHousing.cs index 65d3631..1dc7b4b 100644 --- a/RemoteAgents/AgentHousing.cs +++ b/RemoteAgents/AgentHousing.cs @@ -5,12 +5,18 @@ namespace LlamaLibrary.RemoteAgents { + /// + /// Remote agent for general housing system interactions. + /// public class AgentHousing : AgentInterface, IAgent { + /// public IntPtr RegisteredVtable => AgentHousingOffsets.VTable; - - + /// + /// Initializes a new instance of the class. + /// + /// The memory address of the agent. protected AgentHousing(IntPtr pointer) : base(pointer) { } diff --git a/RemoteAgents/AgentHousingSelectBlock.cs b/RemoteAgents/AgentHousingSelectBlock.cs index 210c4aa..5ab6dfd 100644 --- a/RemoteAgents/AgentHousingSelectBlock.cs +++ b/RemoteAgents/AgentHousingSelectBlock.cs @@ -6,21 +6,36 @@ namespace LlamaLibrary.RemoteAgents { + /// + /// Remote agent for the housing ward selection interface. + /// public class AgentHousingSelectBlock : AgentInterface, IAgent { + /// public IntPtr RegisteredVtable => AgentHousingSelectBlockOffsets.VTable; - + /// + /// Initializes a new instance of the class. + /// + /// The memory address of the agent. protected AgentHousingSelectBlock(IntPtr pointer) : base(pointer) { } + /// + /// Gets or sets the zero-based index of the currently selected ward in the housing block. + /// public int WardNumber { get => Core.Memory.Read(Pointer + AgentHousingSelectBlockOffsets.WardNumber); set => Core.Memory.Write(Pointer + AgentHousingSelectBlockOffsets.WardNumber, value); } + /// + /// Reads an array of bytes representing the status (e.g., availability) of plots in the selected ward. + /// + /// The number of plots to read (usually the total count for the district). + /// A byte array where each element corresponds to a plot's status. public byte[] ReadPlots(int count) { return Core.Memory.ReadArray(Pointer + AgentHousingSelectBlockOffsets.PlotOffset, count); diff --git a/RemoteAgents/AgentHousingSignBoard.cs b/RemoteAgents/AgentHousingSignBoard.cs index 63e2b12..3149983 100644 --- a/RemoteAgents/AgentHousingSignBoard.cs +++ b/RemoteAgents/AgentHousingSignBoard.cs @@ -7,32 +7,63 @@ namespace LlamaLibrary.RemoteAgents { + /// + /// Remote agent for the house or plot signboard interface. + /// public class AgentHousingSignboard : AgentInterface, IAgent { + /// public IntPtr RegisteredVtable => AgentHousingSignBoardOffsets.VTable; - - + /// + /// Initializes a new instance of the class. + /// + /// The memory address of the agent. protected AgentHousingSignboard(IntPtr pointer) : base(pointer) { } + /// + /// Gets the territory ID of the housing zone. + /// public ushort Zone => Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.Zone); + /// + /// Gets the 1-based ward number of the plot. + /// public byte Ward => (byte)(Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.Ward) + 1); + /// + /// Gets the 1-based plot number of the plot. + /// public byte Plot => (byte)(Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.Plot) + 1); + /// + /// Gets a value indicating whether the plot is currently for sale. + /// public bool ForSale => Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.ForSale); + /// + /// Gets the size of the plot (Small, Medium, or Large). + /// public PlotSize Size => (PlotSize)Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.Size); + /// + /// Gets the winning number for the most recent lottery cycle for this plot. + /// public ushort WinningLotteryNumber => Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.LotteryEntryCount + 0xC); + /// + /// Gets the total number of entries in the current or most recent lottery cycle. + /// public ushort LotteryEntryCount => Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.WinningLotteryNumber); + /// + /// Gets a value indicating whether the plot is currently owned by a Free Company. + /// public bool FcOwned => Core.Memory.Read(Pointer + AgentHousingSignBoardOffsets.FcOwned) != 0; + /// public override string ToString() { return $"Zone: {Zone}, Ward: {Ward}, Plot: {Plot}, ForSale: {ForSale}, Size: {Size}, LotteryEntryCount: {LotteryEntryCount}, WinningLotteryNumber: {WinningLotteryNumber}, FcOwned: {FcOwned}"; diff --git a/RemoteAgents/AgentInclusionShop.cs b/RemoteAgents/AgentInclusionShop.cs index e092409..ecd5856 100644 --- a/RemoteAgents/AgentInclusionShop.cs +++ b/RemoteAgents/AgentInclusionShop.cs @@ -59,16 +59,19 @@ public class AgentInclusionShop : AgentInterface, IAgent /// /// Gets the actual (true) category identifier based on the user's selection index. + /// This identifier is used as an index into the shop's structural arrays. /// public int TrueCategory => Core.Memory.Read(StartOfShopThing + AgentInclusionShopOffsets.CategoryArray + SelectedCategory); /// /// Gets the pointer to the currently active category data. + /// This pointer represents the start of the sub-category array for the selected category. /// public IntPtr CategoryPtr => Core.Memory.Read(StartOfShopThing + (TrueCategory * AgentInclusionShopOffsets.StructSizeCategory) + AgentInclusionShopOffsets.SubCategoryArrayStart); /// /// Gets the base pointer for the currently active category's structure. + /// This structure contains metadata about the category, including sub-category counts. /// public IntPtr CategoryPtrPtr => StartOfShopThing + (TrueCategory * AgentInclusionShopOffsets.StructSizeCategory);