Crafter.Debug/examples/Basic/AGENTS.template.md
Jorijn van der Graaf 653813e1e3
chore(transport): drop the CRAFTER_DEBUG_NETWORK hook
The transport needed Crafter.Network's callback API, which lived on an
unpushed branch, so project.cpp took Network from whatever project.cpp
$CRAFTER_DEBUG_NETWORK named. That API and the ~ClientQUIC fix are on
Network's master now (79a2f12), so the hook goes: Network comes from
forgejo, unpinned, or from ../Crafter.Network with --local, as before.

The notes and the README stop telling people to set it, and say which
Network the transport needs. Every test passes with Network cloned from
forgejo, and the example builds and is driven end to end that way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 18:04:22 +01:00

1.2 KiB

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.