feat(client): ContentDB loads canon/ + topics/ built dirs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HuHRPE7VfppUJEaoGBEUqZ
This commit is contained in:
2026-07-11 18:46:55 -05:00
parent 7ce5e4584c
commit a160d3e967
2 changed files with 24 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ var locations: Dictionary = {}
var npcs: Dictionary = {}
var quests: Dictionary = {}
var items: Dictionary = {}
var canon_entities: Dictionary = {}
var topics: Dictionary = {}
static func default_content_root() -> String:
@@ -29,6 +31,8 @@ func load_from(content_root: String) -> void:
npcs = _load_dir(world.path_join("npcs"))
quests = _load_dir(world.path_join("quests"))
items = _load_dir(world.path_join("items"))
canon_entities = _load_dir(world.path_join("canon"))
topics = _load_dir(world.path_join("topics"))
func _load_dir(dir_path: String) -> Dictionary:
@@ -56,6 +60,10 @@ func has_location(id: String) -> bool: return locations.has(id)
func has_npc(id: String) -> bool: return npcs.has(id)
func has_quest(id: String) -> bool: return quests.has(id)
func has_item(id: String) -> bool: return items.has(id)
func canon(id: String) -> Dictionary: return canon_entities.get(id, {})
func topic(id: String) -> Dictionary: return topics.get(id, {})
func has_canon(id: String) -> bool: return canon_entities.has(id)
func has_topic(id: String) -> bool: return topics.has(id)
func companions() -> Array: