comparison engine/core/model/metamodel/object.i @ 267:8eec4c078223

* Removed ObjectLoader as it was both unused and unusable (Closes #353) * Overloaded == and != operators to check if two objects are equal * Const correctness in FIFE::Object
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 13 Jun 2009 19:12:10 +0000
parents 90005975cdbb
children 6177cdf72489
comparison
equal deleted inserted replaced
266:475f83e227e0 267:8eec4c078223
35 class Object : public ResourceClass { 35 class Object : public ResourceClass {
36 public: 36 public:
37 Object(const std::string& identifier, const std::string& name_space, Object* inherited=NULL); 37 Object(const std::string& identifier, const std::string& name_space, Object* inherited=NULL);
38 ~Object(); 38 ~Object();
39 39
40 const std::string& getId(); 40 const std::string& getId() const { return m_id; }
41 const std::string& getNamespace(); 41 const std::string& getNamespace() const { return m_namespace; }
42 42
43 Action* createAction(const std::string& identifier, bool is_default=false); 43 Action* createAction(const std::string& identifier, bool is_default=false);
44 Action* getAction(const std::string& identifier); 44 Action* getAction(const std::string& identifier) const;
45 Action* getDefaultAction(); 45 Action* getDefaultAction() const { return m_defaultaction; }
46 46
47 void setPather(AbstractPather* pather); 47 void setPather(AbstractPather* pather);
48 AbstractPather* getPather(); 48 AbstractPather* getPather() const { return m_pather; }
49 49
50 Object* getInherited(); 50 Object* getInherited() const { return m_inherited; }
51 void adoptVisual(AbstractVisual* visual); 51 void adoptVisual(AbstractVisual* visual) { m_visual = visual; }
52 template<typename T> T* getVisual() const; 52 template<typename T> T* getVisual() const { return reinterpret_cast<T*>(m_visual); }
53
54 void setBlocking(bool blocking);
55 bool isBlocking();
56
57 void setStatic(bool stat);
58 bool isStatic();
59 };
60 53
61 class ObjectLoader : public ResourceLoader { 54 void setBlocking(bool blocking) { m_blocking = blocking; }
62 public: 55 bool isBlocking() const;
63 Object* load(const ResourceLocation& location); 56
64 Object* load(const std::string& filename); 57 void setStatic(bool stat) { m_static = stat; }
58 bool isStatic() const;
59
60 bool operator==(const Object& obj) const;
61 bool operator!=(const Object& obj) const;
62
65 }; 63 };
66 } 64 }