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

Undo/Redo #5

Closed
KingKnecht opened this issue Jun 15, 2015 · 1 comment
Closed

Undo/Redo #5

KingKnecht opened this issue Jun 15, 2015 · 1 comment
Labels

Comments

@KingKnecht
Copy link

Hi,
I know this is a little bit off topic. But maybe you can help me. Let's say I want to write a strategy based game where you can create and place new "entities" (e.g. a warrior) on a battle field. This warrior can move, attack and so on. I I like to provide a Undo/Redo functionality for the game. Would it be possible have an separate layer for Undo/Redo or should Undo/Redo be integrated into the core of Entitas?
Undo/Redo should be capable of following use cases:

  1. Create entity <-> Delete entity
  2. Add component to entity <-> Remove component from entity
  3. Set new value of property on component -> Restore old value on component

Any hint would be greatly appreciated.
Thanks,
Sven

@sschmid
Copy link
Owner

sschmid commented Jun 15, 2015

Hi Sven,

in order to Undo/Redo we would need some kind of history of actions or sth like that. I was already thinking of sth like this and came to the conclusion, that this should be part of the application layer and not part of Entitas. Although it might be nice to have such functionality built in, I fear that it would have an impact on overall performance, even if you are not using this feature. I try to keep the core very small and efficient, so my suggestion would be to selectively historicize the entities that should be affected by this feature. But if you have a nice idea, how we could add this feature without sacrificing overall performance, I'd love to discuss that with you. Feel free to make a pull request.

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

No branches or pull requests

2 participants