From a0a4753cc51be1976f4b64be2dab4d13490facb2 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Sat, 12 Oct 2013 13:07:53 -0400 Subject: Allow creation of Entity::Id from uint64_t. --- entityx/Entity.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entityx/Entity.h b/entityx/Entity.h index 8edd109..cfcf12c 100644 --- a/entityx/Entity.h +++ b/entityx/Entity.h @@ -45,6 +45,7 @@ class Entity { public: struct Id { Id() : id_(0) {} + explicit Id(uint64_t id) : id_(id) {} Id(uint32_t index, uint32_t version) : id_(uint64_t(index) | uint64_t(version) << 32UL) {} uint64_t id() const { return id_; } @@ -76,7 +77,7 @@ public: /** * Check if Entity handle is invalid. */ - operator bool () const { + operator bool() const { return valid(); } -- cgit v1.2.3