This commit is contained in:
Jonas H
2026-03-28 13:23:42 +01:00
parent 5c94bb34d5
commit 6b475825c2

View File

@@ -10,6 +10,12 @@ Pure Rust game: SDL3 windowing, wgpu rendering, rapier3d physics, low-res retro
- **NO inline paths** — always add `use` statements at the top of files, never inline - **NO inline paths** — always add `use` statements at the top of files, never inline
- **NO `use` statements inside functions or impl blocks** — all `use` must be at the file (module) level - **NO `use` statements inside functions or impl blocks** — all `use` must be at the file (module) level
**Intent-Based Architecture:**
- Systems don't call each other. Cross-system communication goes through **intents** — one-frame typed structs in `Storage<T>` queues on `World`
- Producer inserts intent → consumer reads, acts, removes. Producer doesn't know which system processes it
- The main loop is a flat pipeline; systems self-gate based on data presence
- See `docs/self-gating-systems.md` for full pattern + examples
**Storage Parameters:** **Storage Parameters:**
- Functions should take specific storages they need rather than `&World` or `&mut World` - Functions should take specific storages they need rather than `&World` or `&mut World`
- Pass individual fields (`&world.transforms`, `&mut world.state_machines`) at the call site - Pass individual fields (`&world.transforms`, `&mut world.state_machines`) at the call site