Added inequality operator to EntityWrapper
This commit is contained in:
@@ -28,6 +28,7 @@ struct EntityWrapper
|
|||||||
|
|
||||||
ComponentWrapper operator[](const char* componentName);
|
ComponentWrapper operator[](const char* componentName);
|
||||||
bool operator==(const EntityWrapper& e) const;
|
bool operator==(const EntityWrapper& e) const;
|
||||||
|
bool operator!=(const EntityWrapper& e) const;
|
||||||
explicit operator EntityID() const;
|
explicit operator EntityID() const;
|
||||||
operator bool();
|
operator bool();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
const EntityWrapper EntityWrapper::Invalid = EntityWrapper(nullptr, EntityID_Invalid);
|
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)
|
bool EntityWrapper::HasComponent(const std::string& componentName)
|
||||||
{
|
{
|
||||||
return World->HasComponent(ID, 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
|
EntityWrapper::operator EntityID() const
|
||||||
{
|
{
|
||||||
return this->ID;
|
return this->ID;
|
||||||
|
|||||||
Reference in New Issue
Block a user