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/resource/resource.h"
00037 #include "util/math/angles.h"
00038
00039 namespace FIFE {
00040
00041 class Action;
00042 class IPather;
00043 class IVisual;
00044
00051 class Object {
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(IPather* pather);
00101
00104 IPather* getPather() const { return m_pather; }
00105
00109 Object* getInherited() const { return m_inherited; }
00110
00113 void adoptVisual(IVisual* 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 void setFilename(const std::string& file) { m_filename = file; }
00136 const std::string& getFilename() const { return m_filename; }
00137
00138 bool operator==(const Object& obj) const;
00139 bool operator!=(const Object& obj) const;
00140
00141 private:
00142 std::string m_id;
00143 std::string m_namespace;
00144 std::string m_filename;
00145 Object* m_inherited;
00146 std::map<std::string, Action*>* m_actions;
00147 bool m_blocking;
00148 bool m_static;
00149 IPather* m_pather;
00150 IVisual* m_visual;
00151 Action* m_defaultaction;
00152 };
00153
00154 }
00155 #endif
00156