MAPG-203 select places at the beginning of the game
default-pipeline default-pipeline #21

This commit is contained in:
bence committed 2021-03-17 22:47:11 +01:00
1 parent 01f0f7d4bc
commit edd8c0f8a4
3 files changed
+58 -53

No files matched your search

+15
View File
@@ -28,6 +28,21 @@ class PlaceRepository
yield from $this->pdm->selectMultipleFromDb($select, Place::class);
}
//TODO: use Map instead of id
public function getRandomNForMapWithValidPano(int $mapId, int $n, array $exclude = []): array
{
$places = [];
for ($i = 1; $i <= $n; ++$i) {
$place = $this->getRandomForMapWithValidPano($mapId, $exclude);
$places[] = $place;
$exclude[] = $place->getId();
}
return $places;
}
//TODO: use Map instead of id
public function getRandomForMapWithValidPano(int $mapId, array $exclude = []): Place
{