Most of the code is test code, which includes some (not very useful, but realistic) benchmarks.
Do not merge
Because this will break current engo. We'll have to wait before we have a PR for those changes as well.
Changes
Priority() is now optional on Systems. If that function is missing, a default priority of 0 is assumed.
NewBasic creates a new UID for the BasicEntity. It uses incremental integers.
NewBasics does that X amount of times (faster so you don't have to lock/unlock mutexes all the time)
Systems will have to implement their own Add method, with all the parameters they want and need. The user has to check which parameters are required by which systems he wants to use. ecs has no knowledge of that.
Remove and RemoveEntity (on the World) allow for easy removal across the entire world / system. This way, you don't have to remember which systems you added your Entity to. This is why every System has to implement the Remove function.
Fixes #13
Please review.
Most of the code is test code, which includes some (not very useful, but realistic) benchmarks.
Do not merge
Because this will break current
engo
. We'll have to wait before we have a PR for those changes as well.Changes
Priority()
is now optional onSystem
s. If that function is missing, a default priority of 0 is assumed.NewBasic
creates a new UID for the BasicEntity. It uses incremental integers.NewBasics
does thatX
amount of times (faster so you don't have to lock/unlock mutexes all the time)Add
method, with all the parameters they want and need. The user has to check which parameters are required by which systems he wants to use.ecs
has no knowledge of that.Remove
andRemoveEntity
(on theWorld
) allow for easy removal across the entire world / system. This way, you don't have to remember which systems you added your Entity to. This is why everySystem
has to implement theRemove
function.