diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-09 18:37:30 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-09 18:37:30 +0200 |
| commit | 6058627254cdcecf08551b72211535743385b1c7 (patch) | |
| tree | 14c091bfef2befdc584272390d65a8d56d573d04 /test-client/protocol.ts | |
| parent | 501a0d4e5660f49b504f017038835539facd5785 (diff) | |
| download | hurrycurry-6058627254cdcecf08551b72211535743385b1c7.tar hurrycurry-6058627254cdcecf08551b72211535743385b1c7.tar.bz2 hurrycurry-6058627254cdcecf08551b72211535743385b1c7.tar.zst | |
Book protocol types
Diffstat (limited to 'test-client/protocol.ts')
| -rw-r--r-- | test-client/protocol.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test-client/protocol.ts b/test-client/protocol.ts index a8b0dc31..4a80a37d 100644 --- a/test-client/protocol.ts +++ b/test-client/protocol.ts @@ -80,6 +80,7 @@ export interface Character { export type Menu = { menu: "score", data: Score } + | { menu: "book", data: Book } | { menu: "announce_start" } export interface MessageTimeout { @@ -111,3 +112,30 @@ export type ItemLocation = | { tile: Vec2 } export type PlayerClass = "chef" | "bot" | "customer" | "tram" + +export interface Book { pages: BookPage[] } +export type BookPage = + { page_type: "cover" } + | { page_type: "contents", table: [Message, number][] } + | { page_type: "text", paragraphs: Message[] } + | { page_type: "recipe", descriptions: Message, diagram: Diagram } + +export interface Diagram { + nodes: DiagramNode[] + edges: DiagramEdge[] +} +export interface DiagramNode { + position: Vec2, + label: Message, + style: NodeStyle +} +export interface DiagramEdge { + src: number, + dst: number, +} +export type NodeStyle = + "intermediate_product" + | "final_product" + | "process_active" + | "process_passive" + | "process_instant" |