From: Stefan F. <ste...@we...> - 2012-09-05 11:57:40
|
Erik, is it intentional that the HomeCityNumber refers to the position inside the list of Stops of HexMap? I refer to the following code in method layHome of mapHex: Stop homeCity = stops.get(Math.max(stopNumber - 1, 0)); homes.put(company, homeCity); I thought that mStops.get(...) instead of stops.get(...) would have been the more logical choice as mStops maps the stations/stops ids to the objects. Usually if Rails refer to Stations it is the number defined by position on the tile and not the order number. This caught me by surprise yesterday and took quite some time to track down. This has a strong influence on the definition of the city attribute of the Home tag: Instead of the specification of the station position, it refers to the ordering of stations inside the Tile definition. However in the full loop it makes some sense, as in the Tile definition the stations have ids, that are identical with the ordering of the definitions. But those ids are not used to set up the station numbers, those are based on the position on the tile. As you are the expert of Tile and Map definitions, I want to ask you for your opinion: Is there more behind it or is it something we should fix in the longer run at least (and could add some comments in the code/configuration for this behavior)? Stefan |