Skip to content
Leland Ede edited this page Jun 3, 2016 · 2 revisions

Entities

The primary object for the game engine is the Entity class. Everything that runs through the game engine is some form of an Entity.

Public Parameters

  • Ptr - Type definition for a unique pointer
  • SPtr - Type definition for a shared pointer
  • Component - Type definition for the interface component class
  • CmpData - Type definition for the map data structure for components

Private Parameters

  • _childen - A vector data structure that stores all the entities parented to this entity. If that isn't confusing then I don't know what is today. Another way of thinking of it is this data structure allows the entities to be group together and act as one entity. For example if you have a car and want to have a body, 4 wheels, and a driver you could create the body and then parent all the tires and driver to the body. When you move the body all the children will move making it easier to manage large groups of entities.
  • _component - Data structure to manage all the components attached to this entity.
  • _id - Entity unique identifier that gets assigned when the entity factory creates any new entities.
  • _layer - Not sure why this was added but will do some research into the parameter and see if it is still needed.
  • _nextComponentId - Used when adding a new component to the entity.
  • _maxComponentId - The last component ID in the current component list.
  • _active - A boolean value that denotes if the object needs to be track in the game engine or is it turned off. This typically will get set because of something happening in the game engine that needs to destroy the entity and moves it to the destruction pile.
  • _parent - The parent entity that is used in calculating the current world position.
  • _transform - Shared pointer to a transformation object. This is where all changes to an entity happen.

Public Methods

Private Methods

None have been defined for this core class

Clone this wiki locally