diff options
Diffstat (limited to 'src/gemini/Gemini.php')
-rw-r--r-- | src/gemini/Gemini.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gemini/Gemini.php b/src/gemini/Gemini.php index 507b962..4c420d4 100644 --- a/src/gemini/Gemini.php +++ b/src/gemini/Gemini.php @@ -129,6 +129,25 @@ class Gemini $response = $unitController->sendUnits($request); } + else if (preg_match('@village/(\d+)/(\d+)/send-resources@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]); + + if (preg_match('@village/(\d+)/(\d+)/send-resources/type/(\w+)$@', $request->getPath(), $routeMatch)) { + $request->set('selectedResourceType', $routeMatch[3]); + } + else if (preg_match('@village/(\d+)/(\d+)/send-resources/type/(\w+)/village/(\d+)/(\d+)$@', $request->getPath(), $routeMatch)) { + $request + ->set('selectedResourceType', $routeMatch[3]) + ->set('selectedVillageX', $routeMatch[4]) + ->set('selectedVillageY', $routeMatch[5]); + } + + $villageController = new Village(); + $response = $villageController->sendResources($request); + } + else if (preg_match('@village/(\d+)/(\d+)@', $request->getPath(), $routeMatch)) { $request ->set('x', $routeMatch[1]) |