WeaponSystem now handles "PrimaryFire" input events. It sends out ePlayerDamage event if it hits a player. Included some tests

This commit is contained in:
verysecrethero
2016-01-21 11:55:51 +01:00
parent 7b34e001ba
commit bdebc9de62
4 changed files with 311 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#ifndef WeaponSystem_h__
#define WeaponSystem_h__
//#include <GLFW/glfw3.h>
//#include <glm/common.hpp>
#include "Rendering/IRenderer.h"
#include "Common.h"
#include "Core/System.h"
#include "Core/EPlayerDamage.h"
#include "Core/EShoot.h"
#include "Input/EInputCommand.h"
#include <tuple>
#include <vector>
class WeaponSystem : public ImpureSystem
{
public:
WeaponSystem(EventBroker* eventBroker, IRenderer* renderer);
virtual void Update(World* world, double dt) override;
private:
//methods which will take care of specific events
EventRelay<WeaponSystem, Events::Shoot> m_EShoot;
bool WeaponSystem::OnShoot(const Events::Shoot& e);
EventRelay<WeaponSystem, Events::InputCommand> m_EInputCommand;
bool WeaponSystem::OnInputCommand(const Events::InputCommand& e);
IRenderer* m_Renderer;
std::vector<std::tuple<EntityID, glm::vec2>> m_EShootVector;
double m_TestDamageTotal = 0.0;
};
#endif