Leviathan  0.8.0.0
Leviathan game engine
Leviathan::StateCreationSystem< UsedComponent, ComponentState > Class Template Reference

Base class for all systems that create states from changed components. More...

#include <System.h>

Public Member Functions

void Run (GameWorld &world, std::unordered_map< ObjectID, UsedComponent *> &index, StateHolder< ComponentState > &heldstates, int worldtick)
 

Detailed Description

template<class UsedComponent, class ComponentState>
class Leviathan::StateCreationSystem< UsedComponent, ComponentState >

Base class for all systems that create states from changed components.

Definition at line 196 of file System.h.

Member Function Documentation

◆ Run()

template<class UsedComponent, class ComponentState>
void Leviathan::StateCreationSystem< UsedComponent, ComponentState >::Run ( GameWorld world,
std::unordered_map< ObjectID, UsedComponent *> &  index,
StateHolder< ComponentState > &  heldstates,
int  worldtick 
)
inline

Definition at line 198 of file System.h.

200  {
201  for(auto iter = index.begin(); iter != index.end(); ++iter){
202 
203  auto& component = *iter->second;
204 
205  if(!component.Marked)
206  continue;
207 
208  // Needs a new state //
209  if(heldstates.CreateStateIfChanged(iter->first, component, worldtick)){
210 
211  component.StateMarked = true;
212  }
213 
214  component.Marked = false;
215  }
216  }

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