engine-mk1
Public Member Functions | Public Attributes | List of all members
rz::core::Space Class Reference

The Space class handles processing of System updates. More...

#include <Space.hpp>

Public Member Functions

 Space (const SystemGraph &systemGraph)
 Constructs a Space from the passed SystemGraph. More...
 
Entityoperator[] (UUID64 id)
 Gets the Entity mapped to the passed ID. More...
 
void update (double delta)
 Updates the related Systems with respect to delta. More...
 
EntitycreateEntity ()
 Creates a new empty Entity. More...
 
std::size_t removeEntity (UUID64 id)
 Removes an Entity from the Space. More...
 
void registerHandler (rz::eventstream::EventType type, rz::eventstream::EventHandler handler)
 Calls registerHandler on the member EventStream with the given arguments. More...
 
void extendHandler (rz::eventstream::EventType type, rz::eventstream::EventHandler handler)
 Calls registerHandler on the member EventStream with the given arguments. More...
 
void pushEvents (const std::vector< rz::eventstream::Event > &events, rz::eventstream::StreamType streamType)
 Calls pushEvents on the member EventStream. More...
 
EntityMap & getEntities () noexcept
 
UUID64 getID () noexcept
 Gets the unique ID of this Space. More...
 

Public Attributes

std::shared_ptr< rz::taskscheduler::TaskScheduler_taskScheduler
 

Detailed Description

The Space class handles processing of System updates.

For more information and examples, see page Core.

Constructor & Destructor Documentation

Space::Space ( const SystemGraph systemGraph)

Constructs a Space from the passed SystemGraph.

Member Function Documentation

Entity & Space::createEntity ( )

Creates a new empty Entity.

Returns
A reference to the created Entity.
void Space::extendHandler ( rz::eventstream::EventType  type,
rz::eventstream::EventHandler  handler 
)

Calls registerHandler on the member EventStream with the given arguments.

UUID64 rz::core::Space::getID ( )
inlinenoexcept

Gets the unique ID of this Space.

Returns
The unique id of this Space.
Entity & Space::operator[] ( UUID64  id)

Gets the Entity mapped to the passed ID.

Parameters
idThe ID of the Entity to search for.
Exceptions
std::invalid_argumentThrows if the ID maps to no Entity.
Returns
A reference to the mapped Entity.
void Space::pushEvents ( const std::vector< rz::eventstream::Event > &  events,
rz::eventstream::StreamType  streamType 
)

Calls pushEvents on the member EventStream.

void Space::registerHandler ( rz::eventstream::EventType  type,
rz::eventstream::EventHandler  handler 
)

Calls registerHandler on the member EventStream with the given arguments.

std::size_t Space::removeEntity ( UUID64  id)

Removes an Entity from the Space.

Parameters
idThe UUID64 of the Entity to be deleted.
Returns
The number of Entitys remaining in the Space.
void Space::update ( double  delta)

Updates the related Systems with respect to delta.

If delta is greater than the greatest interval of the System objects in the SystemGraph then the systems are updated with the value of the greatest interval, decreasing the value of delta eachtime until delta is smaller than the greatest inteval.


The documentation for this class was generated from the following files: