SystemEntity and EntityManager #768
MathiasPaulin
started this conversation in
Design discussion
Replies: 1 comment 1 reply
-
I am fine with removing the singletons and make them as private attribute of |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As mentioned in the PR #763 and the issue #767, The singleton
SystemEntity
is managed by theEntityManager
and the lifetime of this singleton is the one of theEntityManager
.The
EntityManager
, that is not a singleton, has the lifetime of theEngine
and is fully managed by theEngine
This lifetime restriction make the notion of singleton quite unappropriated for
SystemEntity
.Note that this discussion should also be related to other singleton whose lifetime is the one of the
Engine
:ComponentMessenger
DebugRender
SystemEntity
As all of these singletons are specific to the
Engine
instance (that is a singleton), we can change their status to private attribute of the engine, with methods in theEngine
allowing to access these attributes. We already did this forSignalManager
,RenderObjectManager
,ShaderManager
andTextureManager
.ComponentMessenger, DebugRender and SystemEntity, whose lifetime is the one of the Engine should be integrated into the Engine as the other managers.
If we do this, there will remain only 2 singletons in the Radium libs :
So the question is :
I think they don't and propose to integrate the 3 singletons above as private attributes into the Engine.
What about this proposal ?
Beta Was this translation helpful? Give feedback.
All reactions