viotecs 1.0
Loading...
Searching...
No Matches
viotecs::system< T > Struct Template Reference

System type. More...

#include <system.hpp>

Public Types

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

Public Member Functions

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

Detailed Description

template<typename... T>
struct 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"; }
};
System type.
Definition system.hpp:57

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

Definition at line 56 of file system.hpp.

Member Typedef Documentation

◆ dependencies

template<typename... T>
using viotecs::system< T >::dependencies = std::tuple<T...>

Definition at line 58 of file system.hpp.

Member Function Documentation

◆ run()

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

Definition at line 59 of file system.hpp.


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