From: Alec Thomas Date: Sat, 12 Oct 2013 17:07:53 +0000 (-0400) Subject: Allow creation of Entity::Id from uint64_t. X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=a0a4753cc51be1976f4b64be2dab4d13490facb2;p=clyne%2Fentityx.git Allow creation of Entity::Id from uint64_t. --- 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(); }