This commit is contained in:
2025-12-26 15:51:55 +00:00
parent 461fc720c7
commit bdea055e68
2 changed files with 30 additions and 6 deletions
+11 -6
View File
@@ -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.
+19
View File
@@ -0,0 +1,19 @@
다음 내용을 기반으로 프로젝트를 다시 분석해서, AGENTS.md 파일을 작성해줘. 폴더나 기본 파일 정도는 생성해도 돼.
## 개요
- 이 프로젝트의 목표는 legacy 폴더에 있는 내용을 TypeScript, pnpm 기반의 monorepo로 재 작성하는 것임
## 게임 로직 설명
- 이 게임은 삼국지 모의전투라는 웹 게임임. 여러명의 장수(플레이어 및 NPC)가 있으며, 이들이 모여 국가를 이루고, 고정된 지도 내의 도시를 점유하고, 서로 도시를 발전시킨 다음, 선전포고 후 전쟁을 하여 최종적으로 하나의 국가가 모든 도시를 점령하면 이기는 게임임.
- 게임에서는 플레이어의 턴은 일정시간마다 한번씩 실행된다. 가령 60분턴이면, 60분사이에 다른 플레이어들의 턴이 모두 실행된 후, 다시 해당 플레이어의 턴이 돌아오는 방식임.
- 현재 시도된 적이 있는 턴 시간 방식은 120분, 60분, 30분, 20분, 10분, 5분, 2분, 1분. 이며, 실험적으로 밤에는 120분턴, 낮 일부 시간은 30분턴으로 하여 하루에 24턴을 유지하는 형태도 시도된 바 있음.
- 시도해보진 않았지만, 1분 미만의 턴 시간도 고려해보긴 하였음.
- 단 NPC 턴의 경우 CPU 부하가 있어서, 기존 php 기반 서버에서는 1분 미만의 턴 시간은 불가능했음. 이론상으로 잘 최적화된다면 30초 서버같은 것도 가능은 할 것으로 예상함.
- 장수의 경우 현재 통솔, 무력, 지력의 3가지 스탯을 가지고 있음.
## 기술 스택
- DBMS의 경우 기존에는 MariaDB(MySQL)을 기반으로 하였으나, 재작성 이후에는 PostgreSQL을 기반으로 할 예정임.
-