We currently have a couple different ways to keep track of entities. This has evolved over time, and with https://github.com/bahrmichael/factorio-tycoon/issues/321 we may now have a good reason to refactor that. For example the town hall is stored as a field on the city, and other supply buildings are stored on a separate field which is invalidated and repopulated occasionally. And treasuries? No idea.
I'll document the current approaches here in more detail, and will then come up with a unified approach.
Todo: document calls to surface.create_entity, that should be easier than reading all the code
For https://github.com/bahrmichael/factorio-tycoon/issues/321
We currently have a couple different ways to keep track of entities. This has evolved over time, and with https://github.com/bahrmichael/factorio-tycoon/issues/321 we may now have a good reason to refactor that. For example the town hall is stored as a field on the city, and other supply buildings are stored on a separate field which is invalidated and repopulated occasionally. And treasuries? No idea.
I'll document the current approaches here in more detail, and will then come up with a unified approach.
Todo: document calls to surface.create_entity, that should be easier than reading all the code