wip
This commit is contained in:
@@ -3,7 +3,17 @@
|
||||
## Project Structure & Module Organization
|
||||
- `legacy/` contains the application source. This is the active codebase.
|
||||
- PHP entry points live under `legacy/` and `legacy/hwe/` (for example `legacy/index.php`, `legacy/hwe/index.php`).
|
||||
- Core PHP domain code is under `legacy/src/sammo/` (PSR-4 `sammo\\` namespace).
|
||||
- `legacy/` is mostly a shell; `legacy/src/` is largely unused.
|
||||
- Core PHP domain logic lives under `legacy/hwe/sammo/` (PSR-4 `sammo\\` namespace).
|
||||
- `legacy/hwe/sammo/` is the game engine core, organized by domain concerns rather than endpoints.
|
||||
- `Command/` contains turn actions (general/nation commands) and their resolution rules.
|
||||
- `API/` exposes engine operations for UI and automation (general, nation, command, message, auction, etc.).
|
||||
- `Event/` and `StaticEvent/` implement dynamic and scheduled event processing.
|
||||
- `General*`, `Nation*`, `WarUnit*`, `City*` classes model game entities and combat/city state.
|
||||
- `Action*` and `Special*` capture traits, personalities, special actions, and scenario effects.
|
||||
- `Trigger*` and `*Trigger` manage conditional logic for units, generals, and state changes.
|
||||
- `Scenario/` and `Scenario.php` define scenario loading and rulesets.
|
||||
- `DTO/`, `VO/`, `Enums/`, `Constraint/` are shared types and validation rules.
|
||||
- Frontend TypeScript/Vue sources are in `legacy/hwe/ts/` with shared components in `legacy/hwe/ts/components/`.
|
||||
- Styles are split between `legacy/css/` and SCSS in `legacy/hwe/scss/`.
|
||||
- Tests: PHPUnit in `legacy/tests/`, TypeScript tests in `legacy/hwe/test-ts/`.
|
||||
@@ -27,11 +37,6 @@ Run commands from `legacy/` unless noted.
|
||||
- Legacy endpoints are named by role: JSON handlers `legacy/hwe/j_*.php`, views `legacy/hwe/v_*.php`, admin pages `legacy/hwe/_admin*.php`.
|
||||
- Vue components use PascalCase filenames (e.g., `legacy/hwe/ts/components/MapViewer.vue`).
|
||||
|
||||
## Testing Guidelines
|
||||
- PHPUnit for PHP (`legacy/tests/*Test.php`).
|
||||
- Mocha for TypeScript (`legacy/hwe/test-ts/*.test.ts`).
|
||||
- Prefer adding tests alongside the module you change; keep naming consistent with existing patterns.
|
||||
|
||||
## Commit & Pull Request Guidelines
|
||||
- Git history is minimal and does not define a strict convention; use short, imperative messages (e.g., "Fix map cache loading").
|
||||
- PRs should include a concise description, testing notes/commands, and screenshots for UI changes.
|
||||
|
||||
Reference in New Issue
Block a user