Commit graph

13 commits

Author SHA1 Message Date
Kamron Batman
1b8aff6b71
test(objects): skip weapon-itemID assertion when TileData is absent
ExtractLean clamps itemID > TileData.MaxItemValue to 1; MaxItemValue is 0 when
tiledata.mul is missing (CI), so Katana's 0x13FF only survives with client data.
Guard with [SkippableFact] + TileDataRequirement.SkipIfMissing() like other
data-dependent tests. The hue/cliloc assertion needs no data and stays a [Fact].

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 13:15:38 -07:00
Kamron Batman
bff08c69d2
perf(objects): batch CAGLoader.BuildTree leaf insertion to O(N)
BuildTree previously grew each category's Nodes array by one element per
object via AppendObject/AppendNode, causing O(N^2) array copies across large
categories (e.g. Items.Uncategorized) on every server startup. Leaves are
now accumulated per-category in a List and flushed with a single array
allocation per category via a new AppendNodes helper. AddFallbackForStaleCache
and LoadLegacy are untouched.

Also adds a JSON round-trip test for ObjectIndexFile/ObjectIndexEntry to
guard the gfx/hue property mapping and the Objects = [] initializer against
double-appending on deserialize.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:05 -07:00
Kamron Batman
d72313b76b
style(objects): drop unused System.Linq imports in extraction tests
Assert.Single(collection, predicate) is an xUnit overload, not LINQ.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:04 -07:00
Kamron Batman
06001a6ea5
refac(objects): CAGLoader consumes index.json cache with live fallback
CAGLoader.Load() now reads Data/objects/index.json (BuildTree) and only
falls back to live type instantiation for entries missing from the
cache (stale-cache warning) or when the index file itself is absent
(LoadLegacy, the original categorization.json live-load, moved verbatim).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:04 -07:00
Kamron Batman
0ac505d7b6
feat(objects): ObjectCacheGenerator core + GenObjects command
Wraps introspection, categorization sync, and cache-building into a
single file-I/O-free Generate() so the full pipeline is testable
without a shard; GenObjects is a thin command that adds file I/O and
operator messaging on top.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:04 -07:00
Kamron Batman
a55d83fc21
feat(objects): ObjectCacheBuilder — assemble index + per-category detail chunks
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:04 -07:00
Kamron Batman
8f20106aec
feat(objects): CategorizationSync.Reconcile — append Uncategorized + report orphans
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:03 -07:00
Kamron Batman
ee0c8c256d
feat(objects): DiscoverConstructibleTypes — all constructible Item/Mobile types
Implement DiscoverConstructibleTypes() method with HasConstructibleCtor helper
to enumerate every non-abstract Item/Mobile subclass in AssemblyHandler.Assemblies
that has at least one [Constructible] ctor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:03 -07:00
Kamron Batman
c71bc4bcd5
feat(objects): ExtractOpl — decode OPL buffer into cliloc/args/text lines
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:03 -07:00
Kamron Batman
685fbc146e
feat(objects): ExtractProperties — [CommandProperty] props with enum expansion
Add ObjectIntrospection.ExtractProperties(Type) to extract public instance
properties carrying [CommandProperty] attribute, including inherited ones.
Properties include type via ObjectNaming.FriendlyTypeName, read/write access
levels, readOnly flag, and enum values expanded via Enum.GetNames.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:03 -07:00
Kamron Batman
95d57afdec
feat(objects): ExtractCtors — constructible ctor arguments
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:02 -07:00
Kamron Batman
d02cb56871
feat(objects): ExtractLean — itemID/hue/name/cliloc from a live instance
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:02 -07:00
Kamron Batman
d8acde2b0a
feat(objects): cache DTOs + chunk-key/friendly-type naming helpers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:02 -07:00