Add null ecs handle for convenience

This commit is contained in:
Nikita Lisitsa 2024-07-19 00:35:37 +03:00
parent 5df29246a5
commit 403e24bf4c

View file

@ -14,6 +14,16 @@ namespace psemek::ecs
friend bool operator == (handle const &, handle const &) = default;
friend auto operator <=> (handle const &, handle const &) = default;
static handle null()
{
return {-1, -1};
}
explicit operator bool() const
{
return (*this) != null();
}
};
inline std::ostream & operator << (std::ostream & out, handle const & handle)