Skip to content

guessGameplayCategory

guessGameplayCategory(path): "unit" | "prop" | "structure" | "npc" | "enemy" | "pc" | "encounter" | undefined

Defined in: packages/declarative-hex-worlds/src/asset-source/scan.ts:170

Guess a model/sprite asset’s SUGGESTED gameplay category from its filename, or undefined when no keyword matches (an uncategorized model). A default the dev accepts or overrides — never authoritative.

Substring (not token) match is deliberate: asset packs favour compound names where the keyword is fused into a word — watchtower (→ structure via tower), treehouse, crossbowman. Requiring a whole-token match would miss those. List order breaks ties when a name carries two keywords (skeleton_warrior → enemy, checked before pc). The result is only ever a SUGGESTION the developer confirms or overrides, so an occasional loose hit costs nothing — it’s one click to correct in the wizard/web flow.

string

"unit" | "prop" | "structure" | "npc" | "enemy" | "pc" | "encounter" | undefined