Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed Manager. Add EntityX class. Largely eradicate use of shared_ptr.
- Loading branch information
1 parent
644d056
commit f212094
Showing
21 changed files
with
274 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f212094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we be able to achieve the goals of contiguous memory by using std::shared_ptr with a custom allocator and deleter?
There are a handful of situations where I found the previous use of shared_ptr really useful.
Transform hierarchies:
I have a Transform component that stores an optional reference to a parent Transform. With shared_ptr, it doesn't matter if the entity (or other object) holding the parent transform is destroyed; the child transform's shared_ptr keeps the parent alive and the child maintains its correct total transform. With ComponentHandle, if the entity holding the parent transform is destroyed, the child transform's ComponentHandle will become invalid and the child will likely shift in space.
Pseudo-instancing:
Having the components as shared_ptr allowed for easily sharing the same component across entities.