Open ppetr opened 12 years ago
Not as easy as it looks. First, DCs are counted at every call of buildable think function, which seems a bit ineffective.
Second, eggs are not counted on every call. The closest supporting egg of an alien building is stored in parentNode
and is only recomputed if the egg is destroyed. To do that correctly and effectively, we should store an array of all eggs that support a building, and recompute it each time one of the referenced eggs dies, or a new egg is built.
We could be to limit the number of eggs that can be built close to each other. Like 5 eggs at one place, or something like that. Having a lot of eggs at a single place is useless anyway.
Most likely this can be copied from the RC count keeping.