From: Patrik Gornicz Date: Sat, 19 Jul 2008 16:04:46 +0000 (-0400) Subject: change to manager namespace, cleaned indentation in manager X-Git-Tag: physics-premerge~194 X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=commitdiff_plain;h=d388f0eca9748dc15b8dc9146b75828bb9dcabf0;p=libbear.git change to manager namespace, cleaned indentation in manager --- diff --git a/src/GameStates/Running.cpp b/src/GameStates/Running.cpp index 10026da..a09f912 100644 --- a/src/GameStates/Running.cpp +++ b/src/GameStates/Running.cpp @@ -4,11 +4,11 @@ /// ***** Constructors/Destructors ***** Running::Running() { - entityManager::init(); + manager::init(); } Running::~Running() { - entityManager::clean(); + manager::clean(); } /// ***** Public Class Methods ***** @@ -16,17 +16,17 @@ void Running::handleInput(bool on_top) const { if( on_top ) { - entityManager::handleInput(); + manager::handleInput(); } } void Running::update(float time_step, bool on_top) const { if( on_top ) { - entityManager::update(time_step); + manager::update(time_step); } } void Running::draw(bool on_top) const { - entityManager::draw(); + manager::draw(); } diff --git a/src/entityManager.cpp b/src/entityManager.cpp index 351808a..5a6249d 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -27,76 +27,76 @@ bool clearPhysics; /// ***** Public Methods ***** -void entityManager::init() +void manager::init() { } -void entityManager::clean() +void manager::clean() { } -void entityManager::add(Entity* e) +void manager::add(Entity* e) { { - Particle* p = dynamic_cast(e); - if( p != 0 ) - { - particles_To_Add.insert(p); - return; - } + Particle* p = dynamic_cast(e); + if( p != 0 ) + { + particles_To_Add.insert(p); + return; + } } { - PhysicsEntity* p = dynamic_cast(e); - if( p != 0 ) - { - physics_To_Add.insert(p); - return; - } + PhysicsEntity* p = dynamic_cast(e); + if( p != 0 ) + { + physics_To_Add.insert(p); + return; + } } std::cerr << "ENTITY TYPE NOT SUPPORTED BY addEntity()!!"; std::cerr << std::endl; } -void entityManager::remove(Entity* e) +void manager::remove(Entity* e) { { - Particle* p = dynamic_cast(e); - if( p != 0 ) - { - particles_To_Remove.insert(p); - return; - } + Particle* p = dynamic_cast(e); + if( p != 0 ) + { + particles_To_Remove.insert(p); + return; + } } { - PhysicsEntity* p = dynamic_cast(e); - if( p != 0 ) - { - physics_To_Remove.insert(p); - return; - } + PhysicsEntity* p = dynamic_cast(e); + if( p != 0 ) + { + physics_To_Remove.insert(p); + return; + } } std::cerr << "ENTITY TYPE NOT SUPPORTED BY deleteEntity()!!"; std::cerr << std::endl; } -void entityManager::clear() +void manager::clear() { clearParticles = true; clearPhysics = true; } -void entityManager::handleInput() +void manager::handleInput() { // TODO } -void entityManager::update(float time_step) +void manager::update(float time_step) { updateParticles(time_step); updatePhysics(time_step); } -void entityManager::draw() +void manager::draw() { // update active Particle*s for( setPart::iterator it = active_Particles.begin(); diff --git a/src/entityManager.h b/src/entityManager.h index a9d8e36..04d4a1c 100644 --- a/src/entityManager.h +++ b/src/entityManager.h @@ -4,7 +4,7 @@ #include "Entities/Entity.h" /// ***** Header Methods ***** -namespace entityManager +namespace manager { void init(); void clean();