The current implementation of RogueLikeEntity never assigns to the ID field; so it is always 0. This is a critical performance issue because it means that operations for RogueLikeMap.Entities become O(n) instead of the intended O(1).
Proposed Solution
This is fixed implicitly if the proposed solution in #26 is implemented, as the way GoRogue.GameFramework.GameObject implements idGenerator solves this. So one way to fix it would be to simply implement #26.
A minimal solution would involve adding ID = GoRogue.GlobalRandom.DefaultRNG.NextUInt(); to the constructor(s) of RogueLikeEntity. It isn't as flexible as the solution described above, but prevents the efficiency loss.
Issue
The current implementation of
RogueLikeEntity
never assigns to theID
field; so it is always 0. This is a critical performance issue because it means that operations forRogueLikeMap.Entities
becomeO(n)
instead of the intendedO(1)
.Proposed Solution
This is fixed implicitly if the proposed solution in #26 is implemented, as the way
GoRogue.GameFramework.GameObject
implementsidGenerator
solves this. So one way to fix it would be to simply implement #26.A minimal solution would involve adding
ID = GoRogue.GlobalRandom.DefaultRNG.NextUInt();
to the constructor(s) ofRogueLikeEntity
. It isn't as flexible as the solution described above, but prevents the efficiency loss.