Introduce the HubScreen as the main interface for managing resources, units, and mission selection, integrating with the GameStateManager for dynamic data binding. Implement the MissionBoard component to display and select available missions, enhancing user interaction with mission details and selection logic. Update the GameStateManager to handle transitions between game states, ensuring a seamless experience for players. Add tests for HubScreen and MissionBoard to validate functionality and integration with the overall game architecture.
1.6 KiB
1.6 KiB
| description | globs |
|---|---|
| High-level technical standards, file structure, and testing requirements for the Aether Shards project. | src/*.js, test/*.js** |
General Project Standards
Tech Stack
- Engine: Three.js + Vanilla JavaScript (ES Modules).
- UI: LitElement (Web Components).
- State: Custom State Managers (Singletons).
- Persistence: IndexedDB (via Persistence.js).
- Testing: @web/test-runner + @esm-bundle/chai + sinon.
File Structure
- src/core/: The main loop, state management, and input handling.
- src/grid/: Voxel data structures and rendering logic.
- src/units/: Entity classes (Explorer, Enemy).
- src/managers/: Logic controllers (UnitManager, MissionManager).
- src/systems/: Gameplay logic (TurnSystem, EffectProcessor, AI).
- src/generation/: Procedural algorithms.
- src/ui/: LitElement components.
- assets/data/: JSON definitions (Classes, Items, Missions).
Testing Mandate (TDD)
- Test First: All logic must have a corresponding test suite in test/.
- Conditions of Acceptance (CoA): Every feature must define CoAs, and tests must explicitely verify them.
- Headless WebGL: Tests involving Three.js/WebGL must handle headless contexts (SwiftShader) gracefully or use mocks.
- No Global Side Effects: Tests must clean up DOM elements and Three.js resources (dispose()) after execution.
Coding Style
- Use ES6 Modules (import/export).
- Prefer const over let. No var.
- Use JSDoc for all public methods and complex algorithms.
- No Circular Dependencies: Managers should not import GameLoop. GameLoop acts as the orchestrator.