The International Simutrans Forum

Development => Patches & Projects => Topic started by: ceeac on September 25, 2019, 09:05:19 AM

Title: (Yet another) Attempt at a karte_t refactor
Post by: ceeac on September 25, 2019, 09:05:19 AM
So, I have been thinking of doing yet another attempt at refactoring karte_t. My intention is to separate physical map properties like terrain, vehicles, cities etc. from the rest of the members of karte_t.
This first work-in-progress patch just moves these "physical map properties" to a separate map_t class and moves sync_list_t to separate h/cc files.

I am aware that there are now two classes named "map"; map_t seemed fitting, however renaming karte_t to world_t, or game_t as suggested in [this](https://forum.simutrans.com/index.php/topic,13960.msg138441.html#msg138441) comment is a huge task and I do not want to do it without prior discussion.

Some further things I want to do (in no particular order):

Since this is a rather large patch already, I created a branch to be able to view smaller individual commits:
https://github.com/aburch/simutrans/compare/master...ceeac:refactor-world
Title: Re: (Yet another) Attempt at a karte_t refactor
Post by: An_dz on September 26, 2019, 10:55:41 AM
That's looking pretty good, I like it.

I'm just a bit puzzled on why there's now an include for cstring in macros.h. None of the changes seem to require that.
Title: Re: (Yet another) Attempt at a karte_t refactor
Post by: prissi on September 28, 2019, 02:03:06 PM
Maybe call the actual map information "terrain_t" and leave map_t to the actual map to orient on the terrain. I would also put all terrain related into this and not make another terraforming class.

If we do this, I am afraid almost no patch from experimental will be able to be backported and vice versa though.