#pragma once

// game selector — crApp binds to `class Game` through this header, and only one game may be in a
// link because every one of them declares that same class. switching used to mean editing this
// include AND the .cpp entry in both build files, with a mismatch producing no build error at all:
// the link succeeds and the game then runs on another slot's member offsets.
//
// now it is one line. every game .cpp is in the project as a NON-COMPILED item; Game.cpp is
// the only game translation unit, and it pulls in whichever source GAME_NAME names. header and
// source can no longer disagree, because both are spelled from the same token.
//
// the cost of that: a game that is not selected is never compiled, so its errors surface only when
// you select it.
//
//   Game_Dev                    the framework test bed, and the determinism scene
//   Game_IdleBreakout           CORE BREAK — INKWELL: the planet cracker, ink-on-paper palette
//   Game_NovaSurvivors
//   Game_MassEntityDefense
//
// ── the active game: this line and nothing else% ──
#define GAME_NAME   Game_Dev
// ─────────────────────────────────────────────────

// the WASM artifact's name — <name>.html/.js/.wasm/.data/.png, the local server URL, and the exact
// file set the deploy step copies into the web root. deliberately NOT derived from GAME_NAME: this
// is the deploy SLOT, and holding it steady is what keeps one URL and one set of files out there
// across a swap. the cost is that the two can drift, so __build_wasm.py prints GAME_NAME beside it
// on every build. parsed out of this line by CMakeLists.txt (OUTPUT_NAME) and by __build_wasm.py
#define GAME_WASM_OUTPUT_NAME   "dev"

// GAME_NAME is a token, not a string: stringizing it with the extension attached is what keeps the
// header and the source spelled from one place. the indirection is required — a single-level macro
// would stringize the parameter's NAME rather than its expansion
#define GAME_STR2( x )  #x
#define GAME_STR( x )   GAME_STR2( x )
#define GAME_HEADER     GAME_STR( GAME_NAME.h )
#define GAME_SOURCE     GAME_STR( GAME_NAME.cpp )   // read by Game.cpp, the one game TU

#include GAME_HEADER
