From 254eb4a9959e4c281fdeb47378a654de978cb1e4 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 Jan 2024 13:43:05 +0100 Subject: events and satisfaction --- src/gemini/Gemini.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/gemini/Gemini.php') diff --git a/src/gemini/Gemini.php b/src/gemini/Gemini.php index 23915d0..4567958 100644 --- a/src/gemini/Gemini.php +++ b/src/gemini/Gemini.php @@ -104,6 +104,30 @@ class Gemini $response = $unitController->train($request); } + else if (preg_match('@village/(\d+)/(\d+)/unit/(\w+)/location/(\d+)/(\d+)/recall@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]) + ->set('type', $routeMatch[3]) + ->set('lx', $routeMatch[4]) + ->set('ly', $routeMatch[5]); + + $unitController = new Unit(); + $response = $unitController->recall($request); + } + + else if (preg_match('@village/(\d+)/(\d+)/unit/(\w+)/location/(\d+)/(\d+)/send-back@', $request->getPath(), $routeMatch)) { + $request + ->set('x', $routeMatch[1]) + ->set('y', $routeMatch[2]) + ->set('type', $routeMatch[3]) + ->set('lx', $routeMatch[4]) + ->set('ly', $routeMatch[5]); + + $unitController = new Unit(); + $response = $unitController->sendBack($request); + } + else if (preg_match('@village/(\d+)/(\d+)/send-units@', $request->getPath(), $routeMatch)) { $request ->set('x', $routeMatch[1]) -- cgit v1.2.3