Files
fast/format/GameInterface.php
xiadc ac0777e34b feat(游戏模块): 重构比赛逻辑并添加赛制支持
- 移除了原有的比赛时间检查逻辑
- 引入了赛制类文件,实现了比赛自动编排功能
- 新增了 GameMatch 模型用于存储比赛对阵信息
- 优化了数据库事务处理逻辑
- 更新了 Composer 自动加载配置,添加 format 命名空间
2025-05-23 17:37:48 +08:00

25 lines
888 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace format;
/*
赛制文件
1. 团队类型1双打2单打3团队
2. 规则类型1八人转2超八转3混双转4固搭转5固定擂6活动擂7转转8分区转9擂台赛10守擂赛11追分赛12固搭追分赛13大循环群内赛14两队PK赛15战队淘汰赛16单项淘汰赛17分区循环淘汰赛
3. 需要引入新赛制请创建新的类文件,类文件需要实现GameInterface接口,并且文件名为`Game + 团队类型代码 + 规则类型代码.php`。
如:赛制为双打八人转则文件为format/Game11.php。
赛制为单打擂台赛则文件为format/Game29.php。
*/
interface GameInterface
{
// 赛制说明
public function describe(): string;
// 对阵安排
public function match($game,$users): array;
// 奖金分配
public function prize($rank): array;
}