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
#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
| Element | Convention | Example |
|---|---|---|
| Classes | PascalCase | GalaxyEggbertGame |
| Methods | PascalCase | LoadWorld() |
| Private members | camelCase with trailing underscore | lives_, world_ |
| Constants | kPascalCase | kGravity, kMaxObjects |
| Enum values | PascalCase within enum class | GamePhase::Play |
| Namespaces | PascalCase | GalaxyEggbert::Worlds |
| Files | PascalCase, matching class name | GalaxyEggbertGame.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
- Include only
<Urho3D/Urho3DAll.h>via theGEEngine.hppproxy — never include individual Urho3D headers directly in game code. - Use
SharedPtr/WeakPtronly for Urho3D reference-counted objects. Usestd::unique_ptrfor game-owned subsystems. - Subscribe to events using
SubscribeToEvent(); do not poll Urho3D event queues manually.
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).