From: Xiang Wei Date: Thu, 19 Jun 2014 12:00:39 +0000 (-0400) Subject: Override Entity::component() to return a const ComponentHandle X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=5b8e0ae73b4a5c9e19050ceb2b045dd0f5f8b54e;p=clyne%2Fentityx.git Override Entity::component() to return a const ComponentHandle --- diff --git a/entityx/Entity.h b/entityx/Entity.h index 3504f6f..51ecb03 100644 --- a/entityx/Entity.h +++ b/entityx/Entity.h @@ -130,7 +130,10 @@ public: template ComponentHandle component(); - + + template + const ComponentHandle component() const; + template bool has_component() const; @@ -783,6 +786,12 @@ ComponentHandle Entity::component() { return manager_->component(id_); } +template +const ComponentHandle Entity::component() const { + assert(valid()); + return manager_->component(id_); +} + template bool Entity::has_component() const { assert(valid());