Improved interface

EntityHandle are no longer required to pass Entity as arguments
World::CreateEntity() now returns a const EntityHandle&

Former-commit-id: 6fc53ce5759a2a508094bdc61b4471f13f0844ec
This commit is contained in:
Lynix
2015-03-18 00:49:44 +01:00
parent e91313b62d
commit be8f6edeb4
9 changed files with 117 additions and 33 deletions

View File

@@ -149,30 +149,90 @@ namespace Ndk
return lhs.m_entity == rhs.m_entity;
}
inline bool operator==(const Entity& lhs, const EntityHandle& rhs)
{
return &lhs == rhs.m_entity;
}
inline bool operator==(const EntityHandle& lhs, const Entity& rhs)
{
return lhs.m_entity == &rhs;
}
inline bool operator!=(const EntityHandle& lhs, const EntityHandle& rhs)
{
return !(lhs == rhs);
}
inline bool operator!=(const Entity& lhs, const EntityHandle& rhs)
{
return !(lhs == rhs);
}
inline bool operator!=(const EntityHandle& lhs, const Entity& rhs)
{
return !(lhs == rhs);
}
inline bool operator<(const EntityHandle& lhs, const EntityHandle& rhs)
{
return lhs.m_entity < rhs.m_entity;
}
inline bool operator<(const Entity& lhs, const EntityHandle& rhs)
{
return &lhs < rhs.m_entity;
}
inline bool operator<(const EntityHandle& lhs, const Entity& rhs)
{
return lhs.m_entity < &rhs;
}
inline bool operator<=(const EntityHandle& lhs, const EntityHandle& rhs)
{
return !(lhs > rhs);
}
inline bool operator<=(const Entity& lhs, const EntityHandle& rhs)
{
return !(lhs > rhs);
}
inline bool operator<=(const EntityHandle& lhs, const Entity& rhs)
{
return !(lhs > rhs);
}
inline bool operator>(const EntityHandle& lhs, const EntityHandle& rhs)
{
return rhs < lhs;
}
inline bool operator>(const Entity& lhs, const EntityHandle& rhs)
{
return rhs < lhs;
}
inline bool operator>(const EntityHandle& lhs, const Entity& rhs)
{
return rhs < lhs;
}
inline bool operator>=(const EntityHandle& lhs, const EntityHandle& rhs)
{
return !(lhs < rhs);
}
inline bool operator>=(const Entity& lhs, const EntityHandle& rhs)
{
return !(lhs < rhs);
}
inline bool operator>=(const EntityHandle& lhs, const Entity& rhs)
{
return !(lhs < rhs);
}
}
namespace std