xyginext  0.2.0
Second generation of xygine game creation framework
Public Member Functions | List of all members
xy::SystemManager Class Referencefinal
Inheritance diagram for xy::SystemManager:
xy::GuiClient

Public Member Functions

 SystemManager (Scene &, ComponentManager &)
 
 SystemManager (const SystemManager &)=delete
 
 SystemManager (const SystemManager &&)=delete
 
SystemManageroperator= (const SystemManager &)=delete
 
SystemManageroperator= (const SystemManager &&)=delete
 
template<typename T , typename... Args>
T & addSystem (Args &&... args)
 Adds a system of a given type to the manager. If the system already exists nothing is changed. More...
 
template<typename T >
void removeSystem ()
 Removes the system of this type, if it exists.
 
template<typename T >
void setSystemActive (bool active)
 Sets a system active or inactive by adding or removing it from the active systems processing list. More...
 
template<typename T >
T & getSystem ()
 Returns a reference to this system type, if it exists.
 
template<typename T >
bool hasSystem () const
 Returns true if a system of this type exists within the manager.
 
void addToSystems (Entity)
 Submits an entity to all available systems.
 
void removeFromSystems (Entity)
 Removes the given Entity from any systems to which it may belong.
 
void forwardMessage (const Message &)
 Forwards messages to all systems.
 
void process (float)
 Runs a simulation step by calling process() on each system.
 
void showSystemInfo (bool show=true)
 Shows information in an ImGui window for each active system.
 
template<typename T , typename... Args>
T & addSystem (Args &&... args)
 
template<typename T >
void removeSystem ()
 
template<typename T >
void setSystemActive (bool active)
 
template<typename T >
T & getSystem ()
 
template<typename T >
bool hasSystem () const
 
template<typename T >
void removeFromActive ()
 
- Public Member Functions inherited from xy::GuiClient
 GuiClient (const GuiClient &)=default
 
 GuiClient (GuiClient &&)=default
 
GuiClientoperator= (const GuiClient &)=default
 
GuiClientoperator= (GuiClient &&)=default
 
void registerStatusControls (const std::function< void()> &)
 Registers one or more gui controls with the default status window. The given function should include the ui/ImGui functions as they would appear between the Begin() and End() commands without Begin() and End() themselves. These controls will then appear in the default status window all the time the object which inherits this interface exists. DEPRECATED.
 
void registerConsoleTab (const std::string &name, const std::function< void()> &)
 Registers one or more gui controls with the console window. The given function should include the ui/ImGui functions as they would appear between the Begin() and End() commands without Begin() and End() themselves. These controls will then appear in a new tab in the console window all the time the object which inherits this interface exists. More...
 
void registerWindow (const std::function< void()> &)
 Registers a custom window with the ImGui renderer. The given function should include the Begin() and End() calls to create a fully stand-alone window with ImGui. The window will exist all the time the object which inherits this interface exists.
 

Member Function Documentation

◆ addSystem()

template<typename T , typename... Args>
T& xy::SystemManager::addSystem ( Args &&...  args)

Adds a system of a given type to the manager. If the system already exists nothing is changed.

Returns
Reference to the system, for instance a rendering system maybe required elsewhere so a reference to it can be kept.

◆ setSystemActive()

template<typename T >
void xy::SystemManager::setSystemActive ( bool  active)

Sets a system active or inactive by adding or removing it from the active systems processing list.

Parameters
activeSet true to enable the system or false to disable. If the systems does not exist this function has no effect.