From b21316248572cb27ed1f504529ad6680a473022e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 2 Jan 2024 20:42:01 +0100 Subject: gemini --- src/Controller/Map.php | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/Controller/Map.php (limited to 'src/Controller/Map.php') diff --git a/src/Controller/Map.php b/src/Controller/Map.php deleted file mode 100644 index 6967470..0000000 --- a/src/Controller/Map.php +++ /dev/null @@ -1,43 +0,0 @@ - 1], methods: ['GET'])] - public function region(Request $request): Response - { - $x = $request->get('x'); - $y = $request->get('y'); - $range = $request->get('range'); - - $statement = DB::query( - 'select * from villages where x>=:x1 and x<=:x2 and y>=:y1 and y<=:y2', - [ - 'x1' => $x - $range, - 'x2' => $x + $range, - 'y1' => $y - $range, - 'y2' => $y + $range, - ] - ); - $villages = $statement->fetchAll(); - - $map = []; - foreach ($villages as $village) { - $map[$village['x']][$village['y']] = $village; - } - - return new Response(View::render('map.twig', [ - 'x' => $x, - 'y' => $y, - 'range' => $range, - 'map' => $map, - ])); - } -} -- cgit v1.2.3