WIP: Linking in document list. Working on copying relationships to new sessions
This commit is contained in:
@@ -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 &
|
||||
|
||||
Reference in New Issue
Block a user