public function spawnMonster(Map $map) { //coordinates : if ground = land, generateMonster (random). //if ground != land, do not $areaLines = $map->getAreaLines(); foreach ($areaLines as $areaLine) { foreach ($areaLine->getAreas() as $area) { $this->generateMonsterForArea($area); } } return $map; }