The International Simutrans Forum

 

Author Topic: get_halt_list () in cities  (Read 1171 times)

0 Members and 1 Guest are viewing this topic.

Online Yona-TYT

  • Devotee
  • *
  • Posts: 1822
    • Simutrans-BLOG
  • Languages: ES
get_halt_list () in cities
« on: May 24, 2020, 04:08:48 PM »

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.

Offline Andarix

  • *
  • Posts: 358
  • Languages: de
Re: get_halt_list () in cities
« Reply #1 on: May 24, 2020, 04:40:31 PM »
for halts on player see here

for city city_x building_x::get_city()

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4944
  • Languages: EN, DE, AT
Re: get_halt_list () in cities
« Reply #2 on: May 24, 2020, 06:28:36 PM »
There is nothing like this. You have to iterate the tiles within city borders and look for halts with square_x.get_player_halt.

Online Yona-TYT

  • Devotee
  • *
  • Posts: 1822
    • Simutrans-BLOG
  • Languages: ES
Re: get_halt_list () in cities
« Reply #3 on: May 24, 2020, 08:24:52 PM »
There 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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 11056
  • Languages: De,EN,JP
Re: get_halt_list () in cities
« Reply #4 on: May 25, 2020, 01:43:28 PM »
You can iterate over the city buildings, there is already a list you can use.

Online Yona-TYT

  • Devotee
  • *
  • Posts: 1822
    • Simutrans-BLOG
  • Languages: ES
Re: get_halt_list () in cities
« Reply #5 on: May 25, 2020, 04:41:43 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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4944
  • Languages: EN, DE, AT
Re: get_halt_list () in cities
« Reply #6 on: May 26, 2020, 06:11:34 AM »
No.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 11056
  • Languages: De,EN,JP
Re: get_halt_list () in cities
« Reply #7 on: May 26, 2020, 01:08:21 PM »
No, but each tile with a citybuilding should hold the list of connected stops.