coeng

diff src/gobj.h @ 5:0e5da17d589c

decided to really work on this, so first a slight rename
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Feb 2015 01:35:42 +0200
parents src/gameobj.h@b0d8d454c546
children 2f872a179914
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/gobj.h	Sat Feb 14 01:35:42 2015 +0200
     1.3 @@ -0,0 +1,29 @@
     1.4 +#ifndef GAMEOBJECT_H_
     1.5 +#define GAMEOBJECT_H_
     1.6 +
     1.7 +#include <vector>
     1.8 +#include <map>
     1.9 +#include <string>
    1.10 +#include "comp.h"
    1.11 +
    1.12 +class GameObject {
    1.13 +private:
    1.14 +	std::vector<Component*> comp;
    1.15 +	std::map<std::string, Component*> comp_by_name;
    1.16 +
    1.17 +	bool sorted;
    1.18 +
    1.19 +public:
    1.20 +	GameObject();
    1.21 +	~GameObject();
    1.22 +
    1.23 +	bool add_component(Component *c);	// takes ownership
    1.24 +	bool remove_component(Component *c);
    1.25 +	bool delete_component(Component *c);
    1.26 +
    1.27 +	Component *get_component(const char *name) const;
    1.28 +
    1.29 +	void update();
    1.30 +};
    1.31 +
    1.32 +#endif	// GAMEOBJECT_H_