Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make EntityRecord and WorldRecord implement all interfaces of Entity and World #184

Open
XCYRKDSDA opened this issue Jun 12, 2023 · 0 comments

Comments

@XCYRKDSDA
Copy link

The current EntityRecord type only exposes the methods that would make change to the entity. This results in a situation where I have to keep both the Entity instance and the EntityRecord instance and have to distinguish them very carefully to call the getters of the former and the setters of the latter. This is very annoying.

If the EntityRecord type can expose all the Entity's getters, then I only need to have one EntityRecord instance to access all of an entity's information. This would also make sure that I wouldn't accidentally call the setters on the Entity instance, which would cause operations to be performed immediately. The same is true for the WorldRecord type.

Based on the full-functional EntityRecord type, systems that force the use of EntityCommandRecorder can also be implemented. For example, a ABufferedEntitySetSystem could offer an virtual method that looks like:

protetced virtual void Update(T state, in EntityRecord entity) { }

to make sure that all of its implementations would access the entity through a recorder and all operations would be cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant