diff options
author | David LeGare <excaliburhissheath@gmail.com> | 2014-12-20 10:25:47 -0600 |
---|---|---|
committer | David LeGare <excaliburhissheath@gmail.com> | 2014-12-20 10:25:47 -0600 |
commit | 8769f0f5880712d78ee887004c2c1c53bf80acf0 (patch) | |
tree | 7da1cabc85a980a192fe407ffb6f541629a584d8 | |
parent | 38a9e1d2b4d297bd4e3302cccea56d97b84326a4 (diff) |
Rename SystemManager::update_all() and Add Documentation
- Renamed SystemManager::updateAll() to SystemManager::update_all() to
make it consistent with the existing naming convention.
- Added documentation for SystemManager::update_all().
-rw-r--r-- | entityx/System.cc | 2 | ||||
-rw-r--r-- | entityx/System.h | 13 | ||||
-rw-r--r-- | entityx/System_test.cc | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/entityx/System.cc b/entityx/System.cc index fb020fd..009ac9c 100644 --- a/entityx/System.cc +++ b/entityx/System.cc @@ -17,7 +17,7 @@ BaseSystem::Family BaseSystem::family_counter_; BaseSystem::~BaseSystem() { } -void SystemManager::updateAll(TimeDelta dt) { +void SystemManager::update_all(TimeDelta dt) { assert(initialized_ && "SystemManager::configure() not called"); for (auto &pair : systems_) { pair.second->update(entity_manager_, event_manager_, dt); diff --git a/entityx/System.h b/entityx/System.h index 3aad9ea..7c90ef5 100644 --- a/entityx/System.h +++ b/entityx/System.h @@ -142,7 +142,18 @@ class SystemManager : entityx::help::NonCopyable { s->update(entity_manager_, event_manager_, dt); } - void updateAll(TimeDelta dt); + /** + * Call System::update() on all registered systems. + * + * The order which the registered systems are updated is arbitrary but consistent, + * meaning the order which they will be updated cannot be specified, but that order + * will stay the same as long no systems are added or removed. + * + * If the order in which systems update is important, use SystemManager::update() + * to manually specify the update order. EntityX does not yet support a way of + * specifying priority for update_all(). + */ + void update_all(TimeDelta dt); /** * Configure the system. Call after adding all Systems. diff --git a/entityx/System_test.cc b/entityx/System_test.cc index dabb8e8..5810357 100644 --- a/entityx/System_test.cc +++ b/entityx/System_test.cc @@ -117,7 +117,7 @@ TEST_CASE_METHOD(EntitiesFixture, "TestApplyAllSystems") { systems.add<CounterSystem>(); systems.configure(); - systems.updateAll(0.0); + systems.update_all(0.0); Position::Handle position; Direction::Handle direction; Counter::Handle counter; |