ecs::Engine

More...

#include <Engine.hpp>

Public Functions

Name

void

run()

Detailed Description

class ecs::Engine;

The Engine class manages the whole part of systems in ecs in a given world. Systems are, most of the time, short function using components to realise some actions. For example, to make an Entity move, we need a component Position and a component Velocity, the system is the thing who update the position of the Entity according to the Velocity component by adding velocity value to the x & y member of the component position of the Entity.

Public Functions Documentation

function Engine

inline explicit Engine()

Parameters:

  • wSizeWidth width size of the window in pixel, 800px as default

  • wSizeHeight height size of the window in pixel, 600 as default

  • wTitle window's title, "r-type" as default

Constructor of Engine class, it takes care of register every component in the world's registry. It also create a player and an enemy. And finally it takes care of adding every systems related to the components in the initWorld.

function run

inline void run()

Main loop of the current world Actually run while the window is open


Updated on 2022-11-13 at 17:21:37 +0100

Last updated