-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The World struct in src/world/world.zig (lines 47-63) combines multiple high-level concerns:
- Chunk storage management
- World streaming (loading/unloading)
- Rendering
- LOD (Level of Detail) system
- World generation
This violates SRP and creates tight coupling between these concerns.
Current State
World struct mixes storage, streaming, rendering, LOD, and generation responsibilities.
Proposed Solution
Extract three main subsystems:
- WorldStreamer - Already exists, but make it the primary interface for streaming
- WorldRenderer - Already exists, extract from World
- WorldLOD - New struct to encapsulate LOD manager and renderer
Refactor World to be a facade/coordinator that delegates to these subsystems.
Benefits
- Each subsystem can be tested independently
- Clearer boundaries between streaming, rendering, and LOD
- Easier to modify one concern without affecting others
- Better separation of data (storage) from behavior (streaming/rendering)
Acceptance Criteria
- World struct reduced to coordinator role
- WorldStreamer becomes primary streaming interface
- WorldRenderer fully independent
- WorldLOD encapsulates LOD concerns
- All existing functionality preserved
- Tests still pass
Related Files
src/world/world.zigsrc/world/world_streamer.zigsrc/world/world_renderer.zigsrc/world/lod_manager.zigsrc/world/lod_renderer.zig
SOLID Principle
Single Responsibility Principle (SRP)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request