A trigger script of a map might want to loop over entities of all players and gaia.
The function name GetNonGaiaEntities from #3215 might have been an unlucky choice, since it doesn't include entities without owner.
Details
Run D229 instead, which contains and uses this patch.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1156/ for more details.
Code works and is correct, but shouldn't we also add this function to guiInterface since the getEntsByPlayer and getNonGaiaEnts are there too?
I didn't found any occurance with grepping for this function in current code.
As pointed out by fatherbusido the name looks weird, perhaps GetEntitiesWithOwner is better (simply GetEntities won't work since owner = -1 isn't and shouldn't be included)
Agree and as mentioned above and in #3215, the name GetNonGaiaEntities name is wrong too as we don't get non-gaia entities that are not owned by anyone, so should we name that GetAllPlayersEntities as proposed last june? (Ok there was no s in there at the time)
Then this one could be named GetGaiaAndAllPlayersEntities.
Whatever the name is, the function is useful, and name isn't that bad imo
source/simulation2/components/ICmpRangeManager.h | ||
---|---|---|
202 ↗ | (On Diff #1860) | by a player or gaia. |
Maybe the proposed name is not ideal, but we failed to find a good one the entire year and the name is at least symmetric with the existing GetNonGaiaEntities, so not the worst possible name.
Indeed better to have the function with a sub-ideal name than not at all.
Since the patch was uploaded as a preparation of extinct volcano and since we have extinct volcano since half a year, I will add that hunk.
It's the only file using this currently.
Thanks for the reviews.