Crafter.Debug/examples/Basic/AGENTS.template.md

17 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# Basic
A Crafter.Debug example: a headless simulation of balls dropped onto a floor slab, 60 ticks a second.
- **Plain build:** `crafter-build`, run with `crafter-build -r`. It simulates ten seconds as fast as it can and prints how many balls ended up below the floor.
- **Debug build:** this project's debug flag is `--debug-api` and its define `BASIC_DEBUG_API`. The build adds Crafter.Debug, and the app runs in real time until an agent tells it to quit.
## Layout
- `interfaces/Basic.World.cppm`, `implementations/Basic.World.cpp`: the simulation.
- `interfaces/Basic.DebugShim.cppm`: Crafter.Debug's frame-loop and timeline calls, in every build. In the plain build they are stand-ins that do nothing, so the simulation and `main` need no `#ifdef`.
- `interfaces/Basic.DebugCommands.cppm`, `implementations/Basic.DebugCommands.cpp`: the commands and watches, compiled only when `Debug::Use` added Crafter.Debug.
- `implementations/main.cpp`: the loop, with the session under the define.
## Working on Crafter.Debug from here
`project.cpp` loads Crafter.Debug from this checkout (`#pragma crafter dependency "../.."`), so a change there shows up in the next build here.