I need to get a list of the stations in a city for a specific player, something like "city_x.get_halt_list (player_x ())", can this be possible?. ???
Currently he is working on the final chapter of the tutorial concerning aircraft, and do not get a simple way to get the list of stations in a big city.
for halts on player see here (https://www.simutrans-forum.de/mybb/showthread.php?tid=9261&pid=117785#pid117785)
for city city_x building_x::get_city() (http://dwachs.github.io/simutrans-sqapi-doc/classbuilding__x.html#a35567180f7d2df577bcde4397863ad46)
There is nothing like this. You have to iterate the tiles within city borders and look for halts with square_x.get_player_halt.
Quote from: Dwachs on May 24, 2020, 06:28:36 PMThere is nothing like this. You have to iterate the tiles within city borders and look for halts with square_x.get_player_halt.
This was exactly what he wanted to avoid hehehe. :P
You can iterate over the city buildings, there is already a list you can use.
Quote from: prissi on May 25, 2020, 01:43:28 PM
You can iterate over the city buildings, there is already a list you can use.
Does that mean that the stops / stations are like city buildings, therefore they are on the same list? ... I would have to try.
No.
No, but each tile with a citybuilding should hold the list of connected stops.