Initial commit: 投注游戏平台初始化

This commit is contained in:
li
2026-02-25 01:26:58 +08:00
commit 77ca2cc8b3
275 changed files with 237479 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Core;
class GameFactory {
private static $map = [
'pk10' => PK10Algorithm::class,
'dice' => DiceAlgorithm::class,
'xocdia' => XocDiaAlgorithm::class,
];
public static function getAlgorithm(string $gameType): string {
$class = self::$map[$gameType] ?? null;
if (!$class) throw new \RuntimeException("Unknown game type: {$gameType}");
return $class;
}
public static function register(string $gameType, string $class): void {
self::$map[$gameType] = $class;
}
}