getHexes(); $count = count($hexes); $i = 0; foreach ($hexes as $k => $h) { if ($i++ % 7 === 0) { if (method_exists($h, 'setTile')) $h->setTile('building'); } if ($i > 30) break; } } public static function tileDefinitions(): array { return [ ['id' => 'building', 'name' => 'Bâtiment', 'color' => '#708090', 'asset' => '/assets/tiles/building.svg'], ['id' => 'road', 'name' => 'Route', 'color' => '#D2B48C', 'asset' => '/assets/tiles/road-straight.svg'], ['id' => 'park', 'name' => 'Parc', 'color' => '#90EE90', 'asset' => '/assets/tiles/grass.svg'] ]; } }