viotecs 1.1.0
Loading...
Searching...
No Matches
viotecs::System< T > Class Template Reference

System type. More...

#include <system.hpp>

Public Types

using Dependencies = std::tuple< T... >
 

Public Member Functions

virtual void run (std::vector< EntityId > e) const
 

Detailed Description

template<typename... T>
class viotecs::System< T >

System type.

This type is used to identify systems in the game world. Systems are functions that process game objects and are called at any tick by the World.

Systems can query an entity via It's components specified in the template arguments. The system will be called each tick with a list of entities that have all the components specified.

Example of creating a system:

struct system_a : system<component_a, component_b> {
void run (std::vector<entity> e) const override { std::cout << "A\n"; }
};
constexpr TypeId type_id
Definition world.hpp:57

If no components are needed, use system<none>.

Definition at line 37 of file system.hpp.

Member Typedef Documentation

◆ Dependencies

template<typename... T>
using viotecs::System< T >::Dependencies = std::tuple<T...>

Definition at line 40 of file system.hpp.

Member Function Documentation

◆ run()

template<typename... T>
virtual void viotecs::System< T >::run ( std::vector< EntityId e) const
inlinevirtual

Definition at line 41 of file system.hpp.


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