Skip to content

Instantly share code, notes, and snippets.

@redforce01
Last active March 14, 2017 14:26
ComponentBase Class
#ifndef _COMPONENTBASE_H
#define _COMPONENTBASE_H
#define WIN32_LEAN_AND_MEAN
class ComponentBase;
class GameObject;
class ComponentBase
{
private:
GameObject* mOwnerGO;
public:
typedef std::string goc_id_type;
ComponentBase() : mOwnerGO(NULL) {}
virtual ~ComponentBase() {}
virtual const goc_id_type& componentID() const = 0;
virtual const goc_id_type& familyID() const = 0;
void setOwnerGO(GameObject* go) { mOwnerGO = go; }
GameObject* getOwnerGO() const { return mOwnerGO; }
virtual void intialize();
virtual void start();
virtual void update(float frameTime);
virtual void render();
virtual void ai();
virtual void collisions();
virtual void communicate();
};
#endif // !_COMPONENTBASE_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment