Skip to content

Instantly share code, notes, and snippets.

@terryjsmith
Last active August 29, 2015 14:06
Show Gist options
  • Save terryjsmith/ee39ab3a60ba6794e35b to your computer and use it in GitHub Desktop.
Save terryjsmith/ee39ab3a60ba6794e35b to your computer and use it in GitHub Desktop.
Evolution System class
class System {
public:
System();
~System();
// Add a new entity to this system by its component
void AddComponent(Component* component);
// Remove an entity by its component
void RemoveComponent(Component* component);
// Initialize or shut down the system
virtual void Initialize();
virtual void Shutdown();
// Run an update function, passing in the time since the last update in seconds
virtual void Update(float difference);
protected:
// An array/list of components attached to this system
Component** m_components;
// The total size of the components array to loop over
unsigned int m_bucketSize;
// Singleton instance of the system
static System* m_instance;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment