Class Entity

Class Documentation

class Entity

A collection of ECS style components that define an ECS style entity.

Public Functions

Entity(Scene *scene)
Entity &operator=(Entity&&)
bool onAllComponentsAdded()
bool onAllEntitiesAdded()
void registerComponent(Component *component)
bool addDefaultComponent(const String &componentName)
bool addComponent(const String &componentName, const JSON::json &componentData)
bool removeComponent(ComponentID toRemoveComponentID, bool hardRemove = false)
bool hasComponent(ComponentID componentID)
void clear()

Remove all components.

void destroy()

Destruct all components.

Scene *getScene() const
template<class ComponentType = Component>
ComponentType *getComponent()
template<class ComponentType = Component>
ComponentType *getComponentFromID(ComponentID ID)
JSON::json getJSON() const
const String &getName() const
const SceneID getID() const
const String &getFullName() const
const HashMap<ComponentID, Component *> &getAllComponents() const
void bind(const Event::Type &event, const sol::function &function)
bool call(const String &function, const Vector<Variant> &args)
void evaluateScriptOverrides()
bool setScript(const String &path)
bool setScriptJSON(const JSON::json &script)
Script *getScript() const
void draw()

Protected Attributes

Scene *m_Scene
HashMap<ComponentID, Component *> m_Components
Ref<Script> m_Script