From 2bb1387bc42db98dde341002b52c2d979582f7f8 Mon Sep 17 00:00:00 2001 From: hided62 Date: Sat, 25 Jul 2026 08:05:38 +0000 Subject: [PATCH] test: expose legacy trait catalog --- hwe/compare/trait_catalog.php | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 hwe/compare/trait_catalog.php diff --git a/hwe/compare/trait_catalog.php b/hwe/compare/trait_catalog.php new file mode 100644 index 00000000..a26ab89d --- /dev/null +++ b/hwe/compare/trait_catalog.php @@ -0,0 +1,40 @@ + ['ActionNationType', 'ActionNationType'], + 'domestic' => ['ActionSpecialDomestic', 'ActionSpecialDomestic'], + 'war' => ['ActionSpecialWar', 'ActionSpecialWar'], + 'personality' => ['ActionPersonality', 'ActionPersonality'], +]; + +$result = []; +foreach ($groups as $kind => [$directory, $namespace]) { + foreach (glob(__DIR__ . "/../sammo/{$directory}/*.php") ?: [] as $path) { + $key = basename($path, '.php'); + if ($key === 'None' || str_starts_with($key, 'che_event_') || $key === 'che_거상') { + continue; + } + $className = "\\sammo\\{$namespace}\\{$key}"; + $trait = new $className(); + $result[$kind][$key] = [ + 'name' => $trait->getName(), + 'info' => $trait->getInfo(), + ]; + } + ksort($result[$kind]); +} + +echo Json::encode($result);