--- /dev/null
+# Change Log
+
+## 2013-08-18 - Destroying an entity invalidates all other references
+
+Previously, `Entity::Id` was a simple integer index (slot) into vectors in the `EntityManager`. EntityX also maintains a list of deleted entity slots that are reused when new entities are created. This reduces the size and frequency of vector reallocation. The downside though, was that if a slot was reused, entity IDs referencing the entity before reallocation would be invalidated on reuse.
+
+Each slot now also has a version number and a "valid" bit associated with it. When an entity is allocated the version is incremented and the valid bit set. When an entity is destroyed, the valid bit is cleared. `Entity::Id` now contains all of this information and can correctly determine if an ID is still valid across destroy/create.
+
+## 2013-08-17 - Python scripting, and a more robust build system
+
+Two big changes in this release:
+
+1. Python scripting support (alpha).
+ - Bridges the EntityX entity-component system into Python.
+ - Components and entities can both be defined in Python.
+ - Systems must still be defined in C++, for performance reasons.
+
+ Note that there is one major design difference between the Python ECS model and the C++ model: entities in Python can receive and handle events.
+
+ See the [README](https://github.com/alecthomas/entityx/blob/master/entityx/python/README.md) for help, and the [C++](https://github.com/alecthomas/entityx/blob/master/entityx/python/PythonSystem_test.cc) and [Python](https://github.com/alecthomas/entityx/tree/master/entityx/python/entityx/tests) test source for more examples.
+
+2. Made the build system much more robust, including automatic feature selection with manual override.
+++ /dev/null
-# Change Log
-
-## 2013-08-18 - Destroying an entity invalidates all other references
-
-Previously, `Entity::Id` was a simple integer index (slot) into vectors in the `EntityManager`. EntityX also maintains a list of deleted entity slots that are reused when new entities are created. This reduces the size and frequency of vector reallocation. The downside though, was that if a slot was reused, entity IDs referencing the entity before reallocation would be invalidated on reuse.
-
-Each slot now also has a version number and a "valid" bit associated with it. When an entity is allocated the version is incremented and the valid bit set. When an entity is destroyed, the valid bit is cleared. `Entity::Id` now contains all of this information and can correctly determine if an ID is still valid across destroy/create.
-
-## 2013-08-17 - Python scripting, and a more robust build system
-
-Two big changes in this release:
-
-1. Python scripting support (alpha).
- - Bridges the EntityX entity-component system into Python.
- - Components and entities can both be defined in Python.
- - Systems must still be defined in C++, for performance reasons.
-
- Note that there is one major design difference between the Python ECS model and the C++ model: entities in Python can receive and handle events.
-
- See the [README](https://github.com/alecthomas/entityx/blob/master/entityx/python/README.md) for help, and the [C++](https://github.com/alecthomas/entityx/blob/master/entityx/python/PythonSystem_test.cc) and [Python](https://github.com/alecthomas/entityx/tree/master/entityx/python/entityx/tests) test source for more examples.
-
-2. Made the build system much more robust, including automatic feature selection with manual override.
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
+find_package(Boost 1.48.0 REQUIRED COMPONENTS signals)
find_package(Boost 1.48.0 COMPONENTS python)
include_directories(${Boost_INCLUDE_DIR})
endif (Boost_PYTHON_LIBRARY)
if (ENTITYX_BUILD_TESTING)
- find_package(Boost 1.48.0 REQUIRED COMPONENTS timer system)
+ find_package(Boost 1.48.0 REQUIRED COMPONENTS signals timer system)
add_subdirectory(gtest-1.6.0)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
enable_testing()
## Recent Notable Changes
-- 2013-08-21 - Switch to `boost::signals2`.
- 2013-08-18 - Destroying an entity invalidates all other references
- 2013-08-17 - Python scripting, and a more robust build system
-See the [ChangeLog](https://github.com/alecthomas/entityx/blob/master/CHANGES.md) for details.
+See the [ChangeLog](https://github.com/alecthomas/entityx/blob/master/CHANGELOG.md) for details.
## Overview
- A C++ compiler that supports a basic set of C++11 features (ie. recent clang, recent gcc, and maybe (untested) VC++ with the [Nov 2012 CTP](http://www.microsoft.com/en-us/download/details.aspx?id=35515)).
- [CMake](http://cmake.org/)
-- [Boost](http://boost.org) `1.48.0` or higher (links against `boost::signals2`).
+- [Boost](http://boost.org) `1.48.0` or higher (links against `boost::signals`).
Once these dependencies are installed you should be able to build and install EntityX as below. The following options can be passed to cmake to modify how EntityX is built:
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/signals2.hpp>
+#include <boost/signal.hpp>
#include <boost/unordered_map.hpp>
-#include <list>
#include "entityx/config.h"
private:
friend class EventManager;
- std::list<boost::signals2::connection> connections_;
+ std::list<boost::signals::connection> connections_;
};
}
private:
- typedef boost::signals2::signal<void (const BaseEvent*)> EventSignal;
+ typedef boost::signal<void (const BaseEvent*)> EventSignal;
typedef entityx::shared_ptr<EventSignal> EventSignalPtr;
EventManager() {}
namespace std {
// This may or may not work... it definitely does not work on OSX.
-// template <class T> inline T * get_pointer(const std::shared_ptr<T> &p) {
-// return p.get();
-// }
+template <class T> inline T * get_pointer(const std::shared_ptr<T> &p) {
+ return p.get();
+}
}
assert self.direction
assert self.position
assert self.position2
- assert self.position.x == self.position2.x and self.position.y == self.position2.y
- self.position.x += 1
- assert self.position.x == self.position2.x and self.position.y == self.position2.y
+ assert self.position is self.position2