Coding Style
Rules from CLAUDE.md's Current Direction Lock and the existing codebase.
The Direction Lock (binding, not a suggestion)
CnaEngine::Core,
CnaEngine::Graphics; easy-3d until 2026-10-20) are small helpers beside it (must not
hide CNA; not a scene graph or a replacement engine); GalaxyEggbertSimple3D stays as
reference, not to be expanded;
../mobile-eggbert is read-only — its code/data requires explicit approval to reuse,
its assets do not.
No #ifdef Engine Guards
Neither GalaxyEggbertSimple3D nor GalaxyEggbertCNA may use
#ifdef to paper over engine differences — each target speaks its own API
(Simple3D, or CNA + cna-engine) directly. If a backend is missing a feature, that's a problem for the
sub-repo (simple-3d or CNA/cna-engine), not something to
work around here.
Naming Conventions (as used in src/GalaxyEggbertCNA/)
| Element | Convention | Example |
|---|---|---|
| Classes | PascalCase, GE prefix for CNA/Simple3D game classes | GEWorldRuntime, GEBlupiController |
| Methods | PascalCase | LoadFromVwrFile() |
| Constants | kPascalCase | kMoveSpeed, kWorldCenterX |
| Enum values | PascalCase within enum class | GamePhase::Play |
| Namespaces | PascalCase | GalaxyEggbert::Worlds, GalaxyEggbert::CNA, CnaEngine::Graphics |
Header Layout
Public API headers used by tests live under include/GalaxyEggbert/ (all
engine-agnostic: Worlds/, def/, BlockTypes.hpp,
Def.hpp, GameConstants.hpp). Private implementation headers live
beside their .cpp under src/GalaxyEggbertCNA/ or
src/GalaxyEggbertSimple3D/.
Enum Stability
ObjectType, SoundChannel, BlupiAction, and other
def/ enums are frozen to match mobile-eggbert's level/save format exactly — do not
renumber existing values. New values must be appended at the end.
Approval Gates
- Modifying
../mobile-eggbert,../simple-3d, or../cna-engine(which replaced../easy-3don 2026-10-20) requires explicit, per-change user approval. - Copying mobile-eggbert code or data (tables, enums, save-format bytes) requires explicit approval, even data that "looks like just data."
- No Lua unless explicitly requested by the user.