From 4f67e896183c5d4f6ac32661d20ab715e5f6dbc8 Mon Sep 17 00:00:00 2001 From: Zack Mulgrew Date: Fri, 5 Feb 2016 20:14:39 -0800 Subject: Revert change made regarding component inheritance --- README.md | 6 +++--- entityx/help/Pool_test.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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)++; } -- cgit v1.2.3