Upkeep seizures picked containers with a bare Math.random, breaking the platform guarantee that the same seed yields the same game and making wrapper.replay diverge from the original whenever a seizure occurred (seizures are log *events*, not moves, so nothing recorded the choice). Seed a per-upkeep seedrandom stream from the persisted game seed plus the visible log length — which uniquely identifies the upkeep within the game, since each upkeep immediately follows its own Pass/Accept/Decline log entry — so both live play and full replays reproduce the same seizures. Typing removeRandom along the way exposed that warehouse/factory-store seizure messages read .color on a ContainerOnStore (always undefined); they now correctly read .piece.color. |
||
|---|---|---|
| .. | ||
| .vscode | ||
| src | ||
| .eslintrc.js | ||
| .gitignore | ||
| .travis.yml | ||
| index.ts | ||
| LICENSE | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.json | ||
| wrapper.ts | ||
container-engine
Typescript engine for Container.
Setup
Requirements
Recent version of node / pnpm.
Dependencies
In the project's folder:
pnpm
Build
To compile Typescript into javascript:
pnpm build
Test
pnpm test