WIP: Linking in document list. Working on copying relationships to new sessions

This commit is contained in:
2025-06-27 17:52:57 -07:00
parent 93536b0ac2
commit 611eaca5b6
15 changed files with 281 additions and 52 deletions

View File

@@ -74,6 +74,25 @@ export type AnyDocument =
| Session
| Treasure;
export function getDocumentType(doc: AnyDocument): DocumentType {
if (isLocation(doc)) {
return "location";
} else if (isMonster(doc)) {
return "monster";
} else if (isNpc(doc)) {
return "npc";
} else if (isScene(doc)) {
return "scene";
} else if (isSecret(doc)) {
return "secret";
} else if (isSession(doc)) {
return "session";
} else if (isTreasure(doc)) {
return "treasure";
}
throw new Error(`Document type not found: ${JSON.stringify(doc)}`);
}
/** Locations **/
export type Location = Document &