60 lines
1.3 KiB
Markdown
60 lines
1.3 KiB
Markdown
|
|
# KARDS Battle System 演示文件
|
|||
|
|
|
|||
|
|
demo/ 目录包含以下演示文件,展示战斗系统的各种功能:
|
|||
|
|
|
|||
|
|
## 🚀 演示文件列表
|
|||
|
|
|
|||
|
|
### `demo_new_features.py`
|
|||
|
|
**最新功能专项演示**
|
|||
|
|
- 指定位置部署功能
|
|||
|
|
- 修正的回合系统(双方共同行动为一回合)
|
|||
|
|
- 资源增长机制演示
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
python3 demo/demo_new_features.py
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### `main.py`
|
|||
|
|
**主程序入口文件**
|
|||
|
|
- 项目主入口点
|
|||
|
|
- 系统初始化演示
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
python3 demo/main.py
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 🎯 使用说明
|
|||
|
|
|
|||
|
|
1. **确保在项目根目录运行**:
|
|||
|
|
```bash
|
|||
|
|
cd /path/to/kards
|
|||
|
|
python3 demo/demo_new_features.py
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
2. **所有演示都是自动运行的**,无需用户输入
|
|||
|
|
|
|||
|
|
3. **查看输出理解系统机制**:
|
|||
|
|
- 战场状态变化
|
|||
|
|
- 资源管理
|
|||
|
|
- 单位部署和移动
|
|||
|
|
- 战斗计算
|
|||
|
|
|
|||
|
|
## 📚 更多示例
|
|||
|
|
|
|||
|
|
查看 `tests/examples/` 目录获取更多测试示例:
|
|||
|
|
- `test_new_readme_example.py` - README中的示例代码
|
|||
|
|
- `test_readme_example.py` - 旧版本兼容示例
|
|||
|
|
|
|||
|
|
## 🧪 测试所有功能
|
|||
|
|
|
|||
|
|
运行完整测试套件:
|
|||
|
|
```bash
|
|||
|
|
./run_tests.sh
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
或查看特定测试:
|
|||
|
|
```bash
|
|||
|
|
python3 tests/unit/test_battle_engine.py # 战斗引擎测试
|
|||
|
|
python3 tests/unit/test_position_deployment.py # 位置部署测试
|
|||
|
|
python3 tests/unit/test_turn_system.py # 回合系统测试
|
|||
|
|
```
|