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

WorldElement/GameElement #542

Open
mrzzzrm opened this issue Mar 29, 2014 · 0 comments
Open

WorldElement/GameElement #542

mrzzzrm opened this issue Mar 29, 2014 · 0 comments

Comments

@mrzzzrm
Copy link

mrzzzrm commented Mar 29, 2014

To be discussed in meeting, feel free to leave opinions here.
Everything below is just opinion

The idea is that all Elements we have in a running game, object, polls, scripts, mission, bullets. Maybe even WorldLogic, ... Share the same baseclass: GameElement.
This class

  • provides improved handle()s ([Handle] use internal invalidateOnDelete #518) of every type the element can by dynamic_cast'ed to. So you can do ship.handle< WorldObjec >() and ship.handle< Ship >, but ship.handle< Script > will fail
  • is derived from Scriptable (if the WorldComponents do NOT have this as a baseclass)
  • has a flag to request its removal
  • has a reference to game

All instances are owned by the World, which:

  • update()s all elements
  • removes elements who request this. no remove* method will ever break an iterator

WorldComponents such as the WorldLogic or MissionSystem are just the interface to add Elements to the World and perform special operations.

to be continued

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