Added inequality operator to EntityWrapper

This commit is contained in:
2016-01-18 21:17:24 +01:00
parent d4242bbead
commit 1760f9dfb1
2 changed files with 11 additions and 5 deletions
+10 -5
View File
@@ -3,11 +3,6 @@
const EntityWrapper EntityWrapper::Invalid = EntityWrapper(nullptr, EntityID_Invalid);
bool EntityWrapper::operator==(const EntityWrapper& e) const
{
return (this->World == e.World) && (this->ID == e.ID);
}
bool EntityWrapper::HasComponent(const std::string& componentName)
{
return World->HasComponent(ID, componentName);
@@ -41,6 +36,16 @@ ComponentWrapper EntityWrapper::operator[](const char* componentName)
}
}
bool EntityWrapper::operator==(const EntityWrapper& e) const
{
return (this->World == e.World) && (this->ID == e.ID);
}
bool EntityWrapper::operator!=(const EntityWrapper& e) const
{
return !this->operator==(e);
}
EntityWrapper::operator EntityID() const
{
return this->ID;