HealthSystemTest has been created. This runs a single test simple test with HealthEvents and HealthSystem. Also some minor changes

This commit is contained in:
verysecrethero
2016-01-07 14:29:04 +01:00
parent 638c236ceb
commit a1ed79dfbf
8 changed files with 173 additions and 33 deletions
+2
View File
@@ -11,6 +11,8 @@ struct PlayerDamage : Event
{
double DamageAmount;
EntityID PlayerDamagedID;
//optional TypeOfDamage
std::string TypeOfDamage;
};
}
+3 -1
View File
@@ -9,8 +9,10 @@ namespace Events
struct PlayerDeath : Event
{
std::string KilledBy;
//KilledBy,KilledByWhat is optional for now. It might be used later in the playerlog-system
EntityID KilledBy;
EntityID PlayerID;
std::string KilledByWhat;
};
}
+1 -2
View File
@@ -10,8 +10,7 @@ namespace Events
struct PlayerHealthPickup : Event
{
double HealthAmount;
EntityID HealthPickupID;
EntityID playerHealedID;
EntityID PlayerHealedID;
};
}
+2 -2
View File
@@ -22,13 +22,13 @@ public:
virtual void UpdateComponent(World* world, ComponentWrapper& health, double dt) override;
private:
//create the methods which will take care of specific events
//methods which will take care of specific events
EventRelay<HealthSystem, Events::PlayerDamage> m_EPlayerDamage;
bool HealthSystem::OnPlayerDamaged(const Events::PlayerDamage& e);
EventRelay<HealthSystem, Events::PlayerHealthPickup> m_EPlayerHealthPickup;
bool HealthSystem::OnPlayerHealthPickup(const Events::PlayerHealthPickup& e);
//create the vector which will keep track of health changes
//vector which will keep track of health changes
std::vector<std::tuple<EntityID, double>> m_DeltaHealthVector;
};