Mercurial > fife-parpg
diff 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 |
line wrap: on
line diff
--- a/engine/core/model/metamodel/object.i Sat Jun 13 15:47:16 2009 +0000 +++ b/engine/core/model/metamodel/object.i Sat Jun 13 19:12:10 2009 +0000 @@ -37,30 +37,28 @@ Object(const std::string& identifier, const std::string& name_space, Object* inherited=NULL); ~Object(); - const std::string& getId(); - const std::string& getNamespace(); + const std::string& getId() const { return m_id; } + const std::string& getNamespace() const { return m_namespace; } Action* createAction(const std::string& identifier, bool is_default=false); - Action* getAction(const std::string& identifier); - Action* getDefaultAction(); + Action* getAction(const std::string& identifier) const; + Action* getDefaultAction() const { return m_defaultaction; } void setPather(AbstractPather* pather); - AbstractPather* getPather(); + AbstractPather* getPather() const { return m_pather; } + + Object* getInherited() const { return m_inherited; } + void adoptVisual(AbstractVisual* visual) { m_visual = visual; } + template<typename T> T* getVisual() const { return reinterpret_cast<T*>(m_visual); } - Object* getInherited(); - void adoptVisual(AbstractVisual* visual); - template<typename T> T* getVisual() const; - - void setBlocking(bool blocking); - bool isBlocking(); - - void setStatic(bool stat); - bool isStatic(); - }; + void setBlocking(bool blocking) { m_blocking = blocking; } + bool isBlocking() const; - class ObjectLoader : public ResourceLoader { - public: - Object* load(const ResourceLocation& location); - Object* load(const std::string& filename); + void setStatic(bool stat) { m_static = stat; } + bool isStatic() const; + + bool operator==(const Object& obj) const; + bool operator!=(const Object& obj) const; + }; }