Merge branch 'master' into BoxModelCollision

This commit is contained in:
William Moberg
2016-01-21 17:42:58 +01:00
5 changed files with 10 additions and 11 deletions
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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?
+2 -2
View File
@@ -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<HealthSystem>(0);
m_SystemPipeline->AddSystem<CapturePointSystem>(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();
+1 -1
View File
@@ -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<HealthSystem>(0);
//The Test
+1 -2
View File
@@ -52,8 +52,7 @@ void RegionTestOld(Tree& tree)
template<typename Tree>
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<AABB> outVec;
tree.ObjectsInSameRegion(aabb, outVec);