object.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FIFE_PROTOTYPE_H
00023 #define FIFE_PROTOTYPE_H
00024
00025
00026 #include <string>
00027 #include <map>
00028 #include <list>
00029
00030
00031
00032
00033
00034
00035
00036 #include "util/base/resourceclass.h"
00037 #include "util/math/angles.h"
00038
00039 namespace FIFE {
00040
00041 class Action;
00042 class AbstractPather;
00043 class AbstractVisual;
00044
00051 class Object : public ResourceClass {
00052 public:
00062 Object(const std::string& identifier, const std::string& name_space, Object* inherited=NULL);
00063
00066 ~Object();
00067
00068 const std::string& getId() const { return m_id; }
00069 const std::string& getNamespace() const { return m_namespace; }
00070
00073 void setId(const std::string& id) { m_id = id; }
00074
00084 Action* createAction(const std::string& identifier, bool is_default=false);
00085
00088 Action* getAction(const std::string& identifier) const;
00089
00092 std::list<std::string> getActionIds() const;
00093
00096 Action* getDefaultAction() const { return m_defaultaction; }
00097
00100 void setPather(AbstractPather* pather);
00101
00104 AbstractPather* getPather() const { return m_pather; }
00105
00109 Object* getInherited() const { return m_inherited; }
00110
00113 void adoptVisual(AbstractVisual* visual) { m_visual = visual; }
00114
00117 template<typename T> T* getVisual() const { return reinterpret_cast<T*>(m_visual); }
00118
00121 void setBlocking(bool blocking) { m_blocking = blocking; }
00122
00125 bool isBlocking() const;
00126
00129 void setStatic(bool stat) { m_static = stat; }
00130
00133 bool isStatic() const;
00134
00135 bool operator==(const Object& obj) const;
00136 bool operator!=(const Object& obj) const;
00137
00138 private:
00139 std::string m_id;
00140 std::string m_namespace;
00141 Object* m_inherited;
00142 std::map<std::string, Action*>* m_actions;
00143 bool m_blocking;
00144 bool m_static;
00145 AbstractPather* m_pather;
00146 AbstractVisual* m_visual;
00147 Action* m_defaultaction;
00148 };
00149
00150 }
00151 #endif
00152