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

Calculating power usage of buildings with no power #969

Open
SimplyLiz opened this issue May 29, 2022 · 0 comments
Open

Calculating power usage of buildings with no power #969

SimplyLiz opened this issue May 29, 2022 · 0 comments

Comments

@SimplyLiz
Copy link
Contributor

In PowerManager, each conductive node is added, represented by coordinates and powerLevel.
So it can happen that there are duplicate entries when a zone and a building on top is added.
For all buildings besides power plants, power production is 0. But should be set to 0.

We should change the way nodes are added.
When something is placed or demolish, check if the mapNode.isConductive() flag is still true, and add or remove it. So we won't have duplicates and don't have to care about what is on the node.
When we calculate power levels, we can then check if the buildings layer is occupied and use power usage -1 then

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

1 participant