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

Create an GODefinition object, which stores "type" information for different objects #246

Open
zackthehuman opened this issue Sep 11, 2016 · 0 comments

Comments

@zackthehuman
Copy link
Member

A GameObject instance is an instance of an object in the world. For each object type, there is a set of properties that are intrinsic to the type, and there are instance properties. Instance properties will be part of the GameObject, but other things that are "static" need to be stored somewhere else.

That "somewhere else" is the GODefinition object. There is one definition object per game object type. The game object instances have a read-only pointer back to their definition.

This allows for two things:

  • Keeps GameObject free from properties that are "set once" and never modified
  • Allows for interesting runtime changes like instantly changing all instances of a type by modifying the definition
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