Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor how we keep track of entities #323

Open
bahrmichael opened this issue May 6, 2024 · 1 comment
Open

refactor how we keep track of entities #323

bahrmichael opened this issue May 6, 2024 · 1 comment
Assignees

Comments

@bahrmichael
Copy link
Owner

For #321

We currently have a couple different ways to keep track of entities. This has evolved over time, and with #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

@bahrmichael bahrmichael self-assigned this May 6, 2024
@winex
Copy link
Contributor

winex commented May 6, 2024

i'd like to point to such calls as well as i think it fits here

-- TODO: this could be dropped in favor of Util.getGlobalBuilding()
if global.tycoon_entity_meta_info == nil then
global.tycoon_entity_meta_info = {}
end
global.tycoon_entity_meta_info[entity.unit_number] = {
cityId = city.id
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants