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

World Documentation

Constructors

Function Description Parameters
World(const std::string&) Construct a World. const std::string& - The name of the world. Defaulted to "Nameless World"

World Properties

Function Description Returns Parameters
bool operator==(const World &) const Check if the two World instances are the same. true if they are the same, false otherwise. const World & - A reference to the other World instance.
const std::string &Name() const Get the name of the World. The World's name. N/A

World Operations

Function Description Returns Parameters
void Update(float) Advance the World simulation. N/A float - The amount of time (dt) to advance the simulation by.

Entity Access

Function Description Returns Parameters
Entity& GetEntity(EntityID) Access an Entity instance by ID. A reference to the Entity with the provided ID. ID of the Entity to get.
const Entity& GetEntity(EntityID) const Access an Entity instance by ID. A const reference to the Entity with the provided ID. ID of the Entity to get.

Entity Creation

Function Description Returns Parameters
EntityRef Spawn(ArchetypeRef) Spawns an instance of an Archetype. An EntityRef referencing the newly spawned Entity. An ArchetypeRef to the Archetype that should be spawned.
EntityRef Spawn(EntityRef) Spawns an instance of an Archetype. An EntityRef referencing the newly spawned Entity. An EntityRef to the Archetype that should be spawned.

Component Access

Function Description Returns Parameters
T& GetComponent<T>(EntityID) Access a component of type T on a specific Entity. A reference to the component. The ID of the Entity.
const T& GetComponent<T>(EntityID) Access a component of type T on a specific Entity. A const reference to the component. The ID of the Entity.
void* GetComponent<T>(EntityID, std::type_index) Access a component on a specific Entity without type information. A void * to the component of the provided type.
  • EntityID - The ID of the Entity
  • std::type_index - The type_index of the component type

Systems

Function Description Returns Parameters
void AddSystem<T, Args...>(const std::string &, Args&&...) Add a system of type T to the World. N/A
  • const std::string & - The name of the System. Defaulted to "Nameless System"
  • Args&& - Any arguments in this list will be forwarded to the System constructor.
void RegisterEntitiesWith(EntitiesWith<Args...> &) Registers an instance of EntitiesWith to be updated by the World. N/A EntitiesWith<Args...> & - A reference to the instance that should be kept updated by the World.

Core Engine Types

User Created Types

REST API Reference

Clone this wiki locally