2c0f66d9c7
# Conflicts: # include/Engine/Collision/FillFrustumOctreeSystem.h # include/Engine/Core/Octree.h # include/Engine/Rendering/RenderSystem.h # include/Game/Game.h # resources/DefaultInput.ini # resources/Schema/Components.xsd # resources/Schema/Entities/Player.xml # resources/Schema/Types/Entity.xsd # src/Engine/Rendering/RenderSystem.cpp # src/Game/Game.cpp # src/Game/Systems/PlayerMovementSystem.cpp
37 lines
1011 B
C++
37 lines
1011 B
C++
#ifndef HealthSystem_h__
|
|
#define HealthSystem_h__
|
|
|
|
#include <GLFW/glfw3.h>
|
|
#include <glm/common.hpp>
|
|
|
|
#include "Common.h"
|
|
#include "Core/System.h"
|
|
#include "Core/EPlayerDamage.h"
|
|
#include "Core/EPlayerHealthPickup.h"
|
|
#include "Core/EPlayerDeath.h"
|
|
|
|
#include <tuple>
|
|
#include <vector>
|
|
#include <algorithm>
|
|
|
|
class HealthSystem : public PureSystem
|
|
{
|
|
public:
|
|
HealthSystem(SystemParams params);
|
|
|
|
//updatecomponent
|
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
|
|
|
|
private:
|
|
//methods which will take care of specific events
|
|
EventRelay<HealthSystem, Events::PlayerDamage> m_EPlayerDamage;
|
|
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e);
|
|
EventRelay<HealthSystem, Events::PlayerHealthPickup> m_EPlayerHealthPickup;
|
|
bool HealthSystem::OnPlayerHealthPickup(Events::PlayerHealthPickup& e);
|
|
|
|
//vector which will keep track of health changes
|
|
std::vector<std::tuple<EntityID, double>> m_DeltaHealthVector;
|
|
|
|
};
|
|
|
|
#endif |