From: Zack Mulgrew Date: Sat, 6 Feb 2016 04:14:39 +0000 (-0800) Subject: Revert change made regarding component inheritance X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=4f67e896183c5d4f6ac32661d20ab715e5f6dbc8;p=clyne%2Fentityx.git Revert change made regarding component inheritance --- diff --git a/README.md b/README.md index 43d195c..db124ce 100644 --- a/README.md +++ b/README.md @@ -119,13 +119,13 @@ To that end Components are typically [POD types](http://en.wikipedia.org/wiki/Pl As an example, position and direction information might be represented as: ```c++ -struct Position : public entityx::Component { +struct Position { Position(float x = 0.0f, float y = 0.0f) : x(x), y(y) {} float x, y; }; -struct Direction : public entityx::Component { +struct Direction { Direction(float x = 0.0f, float y = 0.0f) : x(x), y(y) {} float x, y; @@ -224,7 +224,7 @@ As an example, we might want to implement a very basic collision system using ou First, we define the event type, which for our example is simply the two entities that collided: ```c++ -struct Collision : public entityx::Component { +struct Collision { Collision(entityx::Entity left, entityx::Entity right) : left(left), right(right) {} entityx::Entity left, right; diff --git a/entityx/help/Pool_test.cc b/entityx/help/Pool_test.cc index 08ef1d2..1092068 100644 --- a/entityx/help/Pool_test.cc +++ b/entityx/help/Pool_test.cc @@ -15,7 +15,7 @@ #include "entityx/help/Pool.h" #include "entityx/Entity.h" -struct Position : public entityx::Component { +struct Position { explicit Position(int *ptr = nullptr) : ptr(ptr) { if (ptr) (*ptr)++; }