Skip to content
LaBretonne edited this page May 9, 2016 · 1 revision

Entity component system

  • Wikipedia entity component system
  • Every entity has a network id.
  • No copy-constuctor/operator but move-constructor/operator.
  • Component must be inherit from AComponent.
  • Component plug on entity with a ComponentType id.

Entity Methods:

  • Entity(NetworkID netID);

A empty entity, netID can be set/get with:

  • NetworkID getNetworkID() const;
  • void setNetworkID(const NetworkID id);

  • AComponent*& operator[](ComponentType type);

to access (get and set) Component by his ComponentType id.


  • bool has(ComponentType type) const;

return true if this entity has a Component of type 'type'


  • void dump() const;

Call AComponent::dump() of every component of this entity.