feat(bgm): add board game manifest loader
Parse yaml/json/toml and markdown code blocks into packages, expanding $variants via typed-csv and collecting parts, surfaces, and setups by include patterns. Ships zod validation, a vitest config, and 16 tests.
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# Harbor
|
||||
|
||||
A tiny example game used to exercise the bgm loader.
|
||||
|
||||
```yaml file=harbor.yaml
|
||||
role: package
|
||||
id: harbor
|
||||
title: Harbor
|
||||
designer: Jane Doe
|
||||
players: 2
|
||||
language: en
|
||||
```
|
||||
|
||||
## Tokens
|
||||
|
||||
```yaml file=parts/tokens.yaml
|
||||
role: part
|
||||
type: token
|
||||
id: wood
|
||||
face: ./assets/tokens.png
|
||||
faceCrop: [1, 0, 5, 2]
|
||||
back: ./assets/tokens.png
|
||||
backCrop: [3, 0, 5, 2]
|
||||
shape: ./assets/token-shape.png
|
||||
size: [20, 20, 3]
|
||||
fillet: 2
|
||||
```
|
||||
|
||||
```yaml file=parts/tokens.yaml
|
||||
role: part
|
||||
type: token
|
||||
id: grain
|
||||
face: ./assets/tokens.png
|
||||
faceCrop: [0, 0, 5, 2]
|
||||
back: ./assets/tokens.png
|
||||
backCrop: [2, 0, 5, 2]
|
||||
shape: ./assets/token-shape.png
|
||||
size: [20, 20, 3]
|
||||
fillet: 2
|
||||
```
|
||||
|
||||
## Board
|
||||
|
||||
```yaml file=parts/board.yaml
|
||||
type: board
|
||||
id: harbor
|
||||
role: surface
|
||||
size: [300, 200]
|
||||
layout:
|
||||
- route: /dock/:seat
|
||||
candidates:
|
||||
$variants: ./seats.csv
|
||||
- route: /deck
|
||||
x: -100
|
||||
y: 0
|
||||
rotation: 0
|
||||
```
|
||||
|
||||
```csv file=parts/seats.csv
|
||||
seat,x,y,rotation
|
||||
string,number,number,number
|
||||
0,40,0,0
|
||||
1,40,20,0
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
```yaml file=setup/main.yaml
|
||||
role: setup
|
||||
type: game
|
||||
id: main
|
||||
setup:
|
||||
/dock/0: harbor:token#wood
|
||||
/deck: harbor:token#grain
|
||||
```
|
||||
Reference in New Issue
Block a user