diff --git a/include/Game/Systems/WeaponSystem.h b/include/Game/Systems/WeaponSystem.h index b85ba323..5acf72b3 100644 --- a/include/Game/Systems/WeaponSystem.h +++ b/include/Game/Systems/WeaponSystem.h @@ -18,9 +18,9 @@ class WeaponSystem : public ImpureSystem { public: - WeaponSystem(EventBroker* eventBroker, IRenderer* renderer); + WeaponSystem(World* world, EventBroker* eventBroker, IRenderer* renderer); - virtual void Update(World* world, double dt) override; + virtual void Update(double dt) override; private: //methods which will take care of specific events diff --git a/src/Game/Systems/WeaponSystem.cpp b/src/Game/Systems/WeaponSystem.cpp index ec81b08b..11f76490 100644 --- a/src/Game/Systems/WeaponSystem.cpp +++ b/src/Game/Systems/WeaponSystem.cpp @@ -1,7 +1,7 @@ #include "Systems/WeaponSystem.h" -WeaponSystem::WeaponSystem(EventBroker* eventBroker, IRenderer* renderer) - : System(eventBroker) +WeaponSystem::WeaponSystem(World* world, EventBroker* eventBroker, IRenderer* renderer) + : System(world, eventBroker) , ImpureSystem() , m_Renderer(renderer) { @@ -9,7 +9,7 @@ WeaponSystem::WeaponSystem(EventBroker* eventBroker, IRenderer* renderer) EVENT_SUBSCRIBE_MEMBER(m_EShoot, &WeaponSystem::OnShoot); } -void WeaponSystem::Update(World* world, double dt) +void WeaponSystem::Update(double dt) { for (int i = m_EShootVector.size(); i > 0; i--) { @@ -22,7 +22,7 @@ void WeaponSystem::Update(World* world, double dt) continue; } //if its a player, do PlayerDamage event - const bool hasPlayerComponent = world->HasComponent(pickDataFromShot.Entity, "Player"); + const bool hasPlayerComponent = m_World->HasComponent(pickDataFromShot.Entity, "Player"); if (hasPlayerComponent) { Events::PlayerDamage ePlayerDamage; //TODO: damage based on weapontype/class? diff --git a/src/Tests/CapturePointTest.cpp b/src/Tests/CapturePointTest.cpp index 5a041120..ffb01030 100644 --- a/src/Tests/CapturePointTest.cpp +++ b/src/Tests/CapturePointTest.cpp @@ -94,7 +94,7 @@ CapturePointTest::CapturePointTest(int runTestNumber) m_World = new World(); // Create system pipeline - m_SystemPipeline = new SystemPipeline(m_EventBroker); + m_SystemPipeline = new SystemPipeline(m_World,m_EventBroker); m_SystemPipeline->AddSystem(0); m_SystemPipeline->AddSystem(1); @@ -405,7 +405,7 @@ void CapturePointTest::Tick() double dt = 10.0; // Iterate through systems and update world! - m_SystemPipeline->Update(m_World, dt); + m_SystemPipeline->Update(dt); m_EventBroker->Swap(); m_EventBroker->Clear(); diff --git a/src/Tests/HealthSystemTest.cpp b/src/Tests/HealthSystemTest.cpp index dd26793b..b28a14ba 100644 --- a/src/Tests/HealthSystemTest.cpp +++ b/src/Tests/HealthSystemTest.cpp @@ -48,7 +48,7 @@ GameHealthSystemTest::GameHealthSystemTest() fp.MergeEntities(m_World); // Create system pipeline - m_SystemPipeline = new SystemPipeline(m_EventBroker); + m_SystemPipeline = new SystemPipeline(m_World,m_EventBroker); m_SystemPipeline->AddSystem(0); //The Test diff --git a/src/Tests/OctTreeTest.cpp b/src/Tests/OctTreeTest.cpp index edd686f8..d0f25c4c 100644 --- a/src/Tests/OctTreeTest.cpp +++ b/src/Tests/OctTreeTest.cpp @@ -52,8 +52,7 @@ void RegionTestOld(Tree& tree) template void RegionTest(Tree& tree) { - AABB aabb; - aabb.CreateFromCenter(glm::vec3(rand() % LEVEL_BOUNDS, rand() % LEVEL_BOUNDS, rand() % LEVEL_BOUNDS), + AABB aabb = AABB::FromOriginSize(glm::vec3(rand() % LEVEL_BOUNDS, rand() % LEVEL_BOUNDS, rand() % LEVEL_BOUNDS), glm::vec3(rand() % MAXSIZE, rand() % MAXSIZE, rand() % MAXSIZE)); std::vector outVec; tree.ObjectsInSameRegion(aabb, outVec);