From 8769f0f5880712d78ee887004c2c1c53bf80acf0 Mon Sep 17 00:00:00 2001 From: David LeGare Date: Sat, 20 Dec 2014 10:25:47 -0600 Subject: 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(). --- entityx/System.cc | 2 +- entityx/System.h | 13 ++++++++++++- 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(); systems.configure(); - systems.updateAll(0.0); + systems.update_all(0.0); Position::Handle position; Direction::Handle direction; Counter::Handle counter; -- cgit v1.2.3