Last active
August 29, 2015 14:06
-
-
Save terryjsmith/ee39ab3a60ba6794e35b to your computer and use it in GitHub Desktop.
Evolution System class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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