diff engine/core/model/metamodel/object.cpp @ 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.cpp	Sat Jun 13 15:47:16 2009 +0000
+++ b/engine/core/model/metamodel/object.cpp	Sat Jun 13 19:12:10 2009 +0000
@@ -81,7 +81,7 @@
 		return a;
 	}
 
-	Action* Object::getAction(const std::string& identifier) {
+	Action* Object::getAction(const std::string& identifier) const {
 		std::map<std::string, Action*>::const_iterator i;
 		if (m_actions) {
 			i = m_actions->find(identifier);
@@ -99,7 +99,7 @@
 		m_pather = pather;
 	}
 	
-	bool Object::isBlocking() {
+	bool Object::isBlocking() const {
 		if (m_blocking) {
 			return true;
 		}
@@ -109,7 +109,7 @@
 		return false;
 	}
 	
-	bool Object::isStatic() {
+	bool Object::isStatic() const {
 		if (m_static) {
 			return true;
 		}
@@ -118,4 +118,12 @@
 		}
 		return false;
 	}	
+
+	bool Object::operator==(const Object& obj) const {
+		return m_id == obj.getId() && m_namespace == obj.getNamespace();
+	}
+
+	bool Object::operator!=(const Object& obj) const {
+		return m_id != obj.getId() || m_namespace != obj.getNamespace();
+	}
 }