Coding Style

Rules and conventions from CLAUDE.md and the existing codebase.

Language Standard

C++23. Required features used: std::expected, std::flat_map, structured bindings, ranges. Compiler minimum: GCC 13 or Clang 17.

No #ifdef Engine Guards

Critical rule: Do NOT add #ifdef URHO3D_ENGINE, #ifdef U3D, #ifdef NOVA3D, or any engine-conditional code in C++ source files. Engine selection is CMake's responsibility. All C++ code uses the unified Urho3D API.

Source: CLAUDE.md — "no #ifdef engine guards in C++ source. Engine selection is CMake's job."

Naming Conventions

ElementConventionExample
ClassesPascalCaseGalaxyEggbertGame
MethodsPascalCaseLoadWorld()
Private memberscamelCase with trailing underscorelives_, world_
ConstantskPascalCasekGravity, kMaxObjects
Enum valuesPascalCase within enum classGamePhase::Play
NamespacesPascalCaseGalaxyEggbert::Worlds
FilesPascalCase, matching class nameGalaxyEggbertGame.cpp

Header Layout

Public API headers live under include/GalaxyEggbert/. Implementation-private headers live beside their .cpp in src/GalaxyEggbert/. The master include include/GalaxyEggbert/Def.hpp re-exports all public definitions.

Engine API Rules

Enum Stability

ObjectType, SoundChannel, and BlupiAction enum values must not change. These are stored in level files and save data — reassigning values is a data-corruption bug. New values must be appended at the end or use existing unused slots.

U3D Pre-build Path

The U3D engine is expected pre-built at: /rv/data/library/github.com/u3d-community/U3D/cmake-build-debug (set via U3D_HOME CMake variable if different).