-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The App struct in src/game/app.zig (lines 38-81) has grown to 40+ fields and violates the Single Responsibility Principle. It currently manages:
- RHI/Rendering systems
- Audio system
- UI system
- Settings management
- Screen management
- Input handling
- Multiple render passes
This makes the struct difficult to maintain, test, and understand.
Current State
The App struct contains 40+ fields mixing rendering, audio, UI, settings, and game state concerns.
Proposed Solution
Extract cohesive subsystems into separate manager structs:
- RenderSystem - Manages RHI, render graph, render passes, shaders
- AudioSystemManager - Wraps audio system initialization/lifecycle
- UISystemManager - Manages UI system, timing overlay
- SettingsManager - Handles settings persistence and application
- ScreenSystem - Manages screen manager and transitions
Benefits
- Improved testability (can test managers in isolation)
- Reduced cognitive load (smaller, focused structs)
- Better adherence to SRP
- Easier to mock for testing
Acceptance Criteria
- Create
RenderSystemstruct to manage rendering concerns - Create
SettingsManagerfor settings persistence - Reduce App struct field count by at least 50%
- All existing functionality preserved
- Tests still pass
Related Files
src/game/app.zigsrc/game/screen.zig(may need updates)
SOLID Principle
Single Responsibility Principle (SRP)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request