Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
Allan Deutsch edited this page Apr 1, 2018 · 1 revision

Entity Documentation

Constructors

Function Description Parameters
Entity(World &, EntityID) Construct and Entity.
  • World & - The World this Entity is being constructed in.
  • EntityID - The ID of this Entity.
Entity(Entity &&) Move an Entity in memory. Entity && The Entity being moved to this location.
Entity& operator=(Entity &&) Assign an Entity to a new memory location. Entity && The Entity being moved to this location.

Entity Properties

Function Description Returns Parameters
EntityID ID() const Get the ID of this Entity. This Entity's ID. N/A
const std::string &Name() const Get the name of this Entity. This Entity's name. N/A
Entity& Name(const std::string &) Set the name of this Entity. A reference to this Entity. const std::string & - The new name of this Entity.

Component Access

Function Description Returns Parameters
bool Has<T>() const Check if this Entity has a component of type T. true if this Entity has a component of type T, false otherwise. T - The type of component to check for.
bool Has<Components...>() const Check if this Entity has components of multiple types. 'true' if this Entity has components of each type in the Components... parameter pack, false otherwise. Components... - The types of components to check for.
Component& Get<Component>() Get mutable access to a component. A reference to the component of type Component. Component - the type of Component to get.
const Component& Get<Component>() Get immutable access to a component. A const reference to the component of type Component. Component - the const-qualified type of Component to get.

Composition

Function Description Returns Parameters
Component& Add<Component, Args...>(Args&&...) Add a component of type Component. A reference to the component of type Component attached to this Entity.
  • Component - The type of component to add.
  • Args&&... - Arguments to be forwarded to the Component constructor.
void Remove<Component>() Remove the component of type Component from this Entity. N/A Component - the type of component to remove.

Entity Replication

Function Description Returns Parameters
EntityRef Clone() const Make a copy of this Entity. An EntityRef referencing the newly created clone. N/A

Core Engine Types

User Created Types

REST API Reference

Clone this wiki locally