diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-01-08 15:10:10 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-01-08 15:10:10 +0100 |
commit | 82875448c485d26375ed6dea4e64e940f6e10f74 (patch) | |
tree | ff2580447429309824e7d64401ad75e7f756e45e /src/gemini/Gemini.php | |
parent | b21316248572cb27ed1f504529ad6680a473022e (diff) |
gemini
Diffstat (limited to 'src/gemini/Gemini.php')
-rw-r--r-- | src/gemini/Gemini.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gemini/Gemini.php b/src/gemini/Gemini.php index 41b8716..507b962 100644 --- a/src/gemini/Gemini.php +++ b/src/gemini/Gemini.php @@ -103,6 +103,32 @@ class Gemini $response = $unitController->train($request); } + else if (preg_match('@village/(\d+)/(\d+)/send-units@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]); + + if (preg_match('@village/(\d+)/(\d+)/send-units/type/(\w+)$@', $request->getPath(), $routeMatch)) { + $request->set('selectedUnit', $routeMatch[3]); + } + else if (preg_match('@village/(\d+)/(\d+)/send-units/type/(\w+)/village/(\d+)/(\d+)$@', $request->getPath(), $routeMatch)) { + $request + ->set('selectedUnit', $routeMatch[3]) + ->set('selectedVillageX', $routeMatch[4]) + ->set('selectedVillageY', $routeMatch[5]); + } + else if (preg_match('@village/(\d+)/(\d+)/send-units/type/(\w+)/village/(\d+)/(\d+)/action/(\w+)$@', $request->getPath(), $routeMatch)) { + $request + ->set('selectedUnit', $routeMatch[3]) + ->set('selectedVillageX', $routeMatch[4]) + ->set('selectedVillageY', $routeMatch[5]) + ->set('selectedAction', $routeMatch[6]); + } + + $unitController = new Unit(); + $response = $unitController->sendUnits($request); + } + else if (preg_match('@village/(\d+)/(\d+)@', $request->getPath(), $routeMatch)) { $request ->set('x', $routeMatch[1]) |