Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
266:475f83e227e0 | 267:8eec4c078223 |
---|---|
79 } | 79 } |
80 } | 80 } |
81 return a; | 81 return a; |
82 } | 82 } |
83 | 83 |
84 Action* Object::getAction(const std::string& identifier) { | 84 Action* Object::getAction(const std::string& identifier) const { |
85 std::map<std::string, Action*>::const_iterator i; | 85 std::map<std::string, Action*>::const_iterator i; |
86 if (m_actions) { | 86 if (m_actions) { |
87 i = m_actions->find(identifier); | 87 i = m_actions->find(identifier); |
88 } | 88 } |
89 if ((!m_actions) || (i == m_actions->end())) { | 89 if ((!m_actions) || (i == m_actions->end())) { |
97 | 97 |
98 void Object::setPather(AbstractPather* pather) { | 98 void Object::setPather(AbstractPather* pather) { |
99 m_pather = pather; | 99 m_pather = pather; |
100 } | 100 } |
101 | 101 |
102 bool Object::isBlocking() { | 102 bool Object::isBlocking() const { |
103 if (m_blocking) { | 103 if (m_blocking) { |
104 return true; | 104 return true; |
105 } | 105 } |
106 if (m_inherited) { | 106 if (m_inherited) { |
107 return m_inherited->isBlocking(); | 107 return m_inherited->isBlocking(); |
108 } | 108 } |
109 return false; | 109 return false; |
110 } | 110 } |
111 | 111 |
112 bool Object::isStatic() { | 112 bool Object::isStatic() const { |
113 if (m_static) { | 113 if (m_static) { |
114 return true; | 114 return true; |
115 } | 115 } |
116 if (m_inherited) { | 116 if (m_inherited) { |
117 return m_inherited->isStatic(); | 117 return m_inherited->isStatic(); |
118 } | 118 } |
119 return false; | 119 return false; |
120 } | 120 } |
121 | |
122 bool Object::operator==(const Object& obj) const { | |
123 return m_id == obj.getId() && m_namespace == obj.getNamespace(); | |
124 } | |
125 | |
126 bool Object::operator!=(const Object& obj) const { | |
127 return m_id != obj.getId() || m_namespace != obj.getNamespace(); | |
128 } | |
121 } | 129 } |