EquippedItem,Ammo got changed to int instead of double. Loading entities from map the new way in Tests. ComponentWrapper:s Name is now Type
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
|||||||
void AddProperty(std::string fieldName, T defaultValue)
|
void AddProperty(std::string fieldName, T defaultValue)
|
||||||
{
|
{
|
||||||
m_DefaultValues.push_back(defaultValue);
|
m_DefaultValues.push_back(defaultValue);
|
||||||
m_ComponentInfo.Fields[fieldName].Name = typeid(T).name();
|
m_ComponentInfo.Fields[fieldName].Type = typeid(T).name();
|
||||||
m_ComponentInfo.Fields[fieldName].Offset = m_ComponentInfo.Meta.Stride;
|
m_ComponentInfo.Fields[fieldName].Offset = m_ComponentInfo.Meta.Stride;
|
||||||
m_ComponentInfo.Fields[fieldName].Stride = sizeof(T);
|
m_ComponentInfo.Fields[fieldName].Stride = sizeof(T);
|
||||||
m_ComponentInfo.Meta.Stride += sizeof(T);
|
m_ComponentInfo.Meta.Stride += sizeof(T);
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ private:
|
|||||||
bool PlayerSystem::OnMouseRelease(const Events::MouseRelease& e);
|
bool PlayerSystem::OnMouseRelease(const Events::MouseRelease& e);
|
||||||
enum class HeldItem {
|
enum class HeldItem {
|
||||||
None = 0,
|
None = 0,
|
||||||
PrimaryWeapon = 1,
|
PrimaryItem = 1,
|
||||||
SecondaryWeapon = 2
|
SecondaryItem = 2
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<xs:element name="Left" type="t:bool" minOccurs="0"/>
|
<xs:element name="Left" type="t:bool" minOccurs="0"/>
|
||||||
<xs:element name="Back" type="t:bool" minOccurs="0"/>
|
<xs:element name="Back" type="t:bool" minOccurs="0"/>
|
||||||
<xs:element name="Right" type="t:bool" minOccurs="0"/>
|
<xs:element name="Right" type="t:bool" minOccurs="0"/>
|
||||||
<xs:element name="EquippedItem" type="t:double" minOccurs="0"/>
|
<xs:element name="EquippedItem" type="t:int" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="Ammo" type="t:double" minOccurs="0">
|
<xs:element name="Ammo" type="t:int" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Ammo count</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Ammo count</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="CoolDownTimer" type="t:double" minOccurs="0">
|
<xs:element name="CoolDownTimer" type="t:double" minOccurs="0">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</xs:annotation>
|
</xs:annotation>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:all>
|
<xs:all>
|
||||||
<xs:element name="Ammo" type="t:double" minOccurs="0">
|
<xs:element name="Ammo" type="t:int" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Ammo count</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Ammo count</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="CoolDownTimer" type="t:double" minOccurs="0">
|
<xs:element name="CoolDownTimer" type="t:double" minOccurs="0">
|
||||||
|
|||||||
+10
-12
@@ -27,33 +27,31 @@ void PlayerSystem::UpdateComponent(World * world, ComponentWrapper & player, dou
|
|||||||
leftMouseWasReleased = false;
|
leftMouseWasReleased = false;
|
||||||
//get the health component linked to the playerId
|
//get the health component linked to the playerId
|
||||||
double currentHealth = (double)world->GetComponent(player.EntityID, "Health")["Health"];
|
double currentHealth = (double)world->GetComponent(player.EntityID, "Health")["Health"];
|
||||||
double currentAmmo = 0.0;
|
int currentAmmo = 0;
|
||||||
double currentCoolDownTimer = 0.0;
|
double currentCoolDownTimer = 0.0;
|
||||||
|
|
||||||
if (fabs((double)player["EquippedItem"] - (double)HeldItem::PrimaryWeapon) < 0.0001) {
|
if ((int)player["EquippedItem"] == (int)HeldItem::PrimaryItem) {
|
||||||
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "PrimaryItem");
|
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "PrimaryItem");
|
||||||
currentAmmo = (double)currentItem["Ammo"];
|
currentAmmo = (int)currentItem["Ammo"];
|
||||||
currentCoolDownTimer = (double)currentItem["CoolDownTimer"];
|
currentCoolDownTimer = (double)currentItem["CoolDownTimer"];
|
||||||
}
|
}
|
||||||
if (fabs((double)player["EquippedItem"] - (double)HeldItem::SecondaryWeapon) < 0.0001) {
|
if ((int)player["EquippedItem"] == (int)HeldItem::SecondaryItem) {
|
||||||
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "SecondaryItem");
|
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "SecondaryItem");
|
||||||
currentAmmo = (double)currentItem["Ammo"];
|
currentAmmo = (int)currentItem["Ammo"];
|
||||||
currentCoolDownTimer = (double)currentItem["CoolDownTimer"];
|
currentCoolDownTimer = (double)currentItem["CoolDownTimer"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentHealth > 0.0 && currentAmmo > 0.0 && currentCoolDownTimer < 0.001) {
|
if (currentHealth > 0.0 && currentAmmo > 0 && currentCoolDownTimer < 0.001) {
|
||||||
//decrease ammo count
|
//decrease ammo count
|
||||||
//TODO: temp, set the cooldowntimer - probably done in some other system (itemSystem?) later
|
//TODO: temp, set the cooldowntimer - probably done in some other system (itemSystem?) later
|
||||||
if (fabs((double)player["EquippedItem"] - (double)HeldItem::PrimaryWeapon) < 0.0001) {
|
if ((int)player["EquippedItem"] == (int)HeldItem::PrimaryItem) {
|
||||||
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "PrimaryItem");
|
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "PrimaryItem");
|
||||||
int currentAmmoInt = (int)((double)currentItem["Ammo"]);
|
currentItem["Ammo"] = (int)currentItem["Ammo"] - 1;
|
||||||
currentItem["Ammo"] = (double)(currentAmmoInt - 1);
|
|
||||||
currentItem["CoolDownTimer"] = 2.0;//change later!
|
currentItem["CoolDownTimer"] = 2.0;//change later!
|
||||||
}
|
}
|
||||||
if (fabs((double)player["EquippedItem"] - (double)HeldItem::SecondaryWeapon) < 0.0001) {
|
if ((int)player["EquippedItem"] == (int)HeldItem::SecondaryItem) {
|
||||||
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "SecondaryItem");
|
ComponentWrapper& currentItem = world->GetComponent(player.EntityID, "SecondaryItem");
|
||||||
int currentAmmoInt = (int)((double)currentItem["Ammo"]);
|
currentItem["Ammo"] = (int)currentItem["Ammo"] - 1;
|
||||||
currentItem["Ammo"] = (double)(currentAmmoInt - 1);
|
|
||||||
currentItem["CoolDownTimer"] = 2.0;//change later!
|
currentItem["CoolDownTimer"] = 2.0;//change later!
|
||||||
}
|
}
|
||||||
//create and publish the shoot event
|
//create and publish the shoot event
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ BOOST_AUTO_TEST_SUITE_END()
|
|||||||
GameHealthSystemTest::GameHealthSystemTest()
|
GameHealthSystemTest::GameHealthSystemTest()
|
||||||
{
|
{
|
||||||
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
||||||
ResourceManager::RegisterType<EntityXMLFile>("EntityXMLFile");
|
ResourceManager::RegisterType<EntityFile>("EntityFile");
|
||||||
|
|
||||||
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||||
LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get<int>("Debug.LogLevel", 1));
|
LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get<int>("Debug.LogLevel", 1));
|
||||||
@@ -41,8 +41,13 @@ GameHealthSystemTest::GameHealthSystemTest()
|
|||||||
// Create a world
|
// Create a world
|
||||||
m_World = new World();
|
m_World = new World();
|
||||||
std::string mapToLoad = m_Config->Get<std::string>("Debug.LoadMap", "");
|
std::string mapToLoad = m_Config->Get<std::string>("Debug.LoadMap", "");
|
||||||
|
|
||||||
if (!mapToLoad.empty()) {
|
if (!mapToLoad.empty()) {
|
||||||
ResourceManager::Load<EntityXMLFile>(mapToLoad)->PopulateWorld(m_World);
|
auto file = ResourceManager::Load<EntityFile>(mapToLoad);
|
||||||
|
EntityFilePreprocessor fpp(file);
|
||||||
|
fpp.RegisterComponents(m_World);
|
||||||
|
EntityFileParser fp(file);
|
||||||
|
fp.MergeEntities(m_World);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create system pipeline
|
// Create system pipeline
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "Input/KeyboardInputHandler.h"
|
#include "Input/KeyboardInputHandler.h"
|
||||||
#include "Input/MouseInputHandler.h"
|
#include "Input/MouseInputHandler.h"
|
||||||
#include "Core/EKeyDown.h"
|
#include "Core/EKeyDown.h"
|
||||||
#include "Core/EntityXMLFile.h"
|
#include "Core/EntityFile.h"
|
||||||
#include "Core/SystemPipeline.h"
|
#include "Core/SystemPipeline.h"
|
||||||
#include "RaptorCopterSystem.h"
|
#include "RaptorCopterSystem.h"
|
||||||
#include "PlayerSystem.h"
|
#include "PlayerSystem.h"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Game::Game(int argc, char* argv[]) : someOctTree(AABB(-0.5f*worldSize, 0.5f*worl
|
|||||||
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
||||||
ResourceManager::RegisterType<Model>("Model");
|
ResourceManager::RegisterType<Model>("Model");
|
||||||
ResourceManager::RegisterType<Texture>("Texture");
|
ResourceManager::RegisterType<Texture>("Texture");
|
||||||
ResourceManager::RegisterType<EntityXMLFile>("EntityXMLFile");
|
ResourceManager::RegisterType<EntityFile>("EntityFile");
|
||||||
ResourceManager::RegisterType<ShaderProgram>("ShaderProgram");
|
ResourceManager::RegisterType<ShaderProgram>("ShaderProgram");
|
||||||
|
|
||||||
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "Input/KeyboardInputHandler.h"
|
#include "Input/KeyboardInputHandler.h"
|
||||||
#include "Input/MouseInputHandler.h"
|
#include "Input/MouseInputHandler.h"
|
||||||
#include "Core/EKeyDown.h"
|
#include "Core/EKeyDown.h"
|
||||||
#include "Core/EntityXMLFile.h"
|
#include "Core/EntityFile.h"
|
||||||
#include "Core/SystemPipeline.h"
|
#include "Core/SystemPipeline.h"
|
||||||
#include "RaptorCopterSystem.h"
|
#include "RaptorCopterSystem.h"
|
||||||
#include "PlayerSystem.h"
|
#include "PlayerSystem.h"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "Core/ResourceManager.h"
|
#include "Core/ResourceManager.h"
|
||||||
#include "Core/ConfigFile.h"
|
#include "Core/ConfigFile.h"
|
||||||
#include "Rendering/Renderer.h"
|
#include "Rendering/Renderer.h"
|
||||||
#include "Core/EntityXMLFile.h"
|
|
||||||
#include "Engine\Rendering\Texture.h"
|
#include "Engine\Rendering\Texture.h"
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE(resourceManagerTests)
|
BOOST_AUTO_TEST_SUITE(resourceManagerTests)
|
||||||
|
|||||||
@@ -81,9 +81,10 @@ BOOST_AUTO_TEST_SUITE_END()
|
|||||||
ShootEventTest::ShootEventTest(int runTestNumber)
|
ShootEventTest::ShootEventTest(int runTestNumber)
|
||||||
{
|
{
|
||||||
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
ResourceManager::RegisterType<ConfigFile>("ConfigFile");
|
||||||
ResourceManager::RegisterType<EntityXMLFile>("EntityXMLFile");
|
ResourceManager::RegisterType<EntityFile>("EntityFile");
|
||||||
|
|
||||||
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
m_Config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||||
|
std::string mapToLoad = m_Config->Get<std::string>("Debug.LoadMap", "");
|
||||||
LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get<int>("Debug.LogLevel", 1));
|
LOG_LEVEL = static_cast<_LOG_LEVEL>(m_Config->Get<int>("Debug.LogLevel", 1));
|
||||||
|
|
||||||
// Create the core event broker
|
// Create the core event broker
|
||||||
@@ -91,22 +92,26 @@ ShootEventTest::ShootEventTest(int runTestNumber)
|
|||||||
|
|
||||||
// Create a world
|
// Create a world
|
||||||
m_World = new World();
|
m_World = new World();
|
||||||
std::string mapToLoad = m_Config->Get<std::string>("Debug.LoadMap", "");
|
|
||||||
if (!mapToLoad.empty()) {
|
|
||||||
ResourceManager::Load<EntityXMLFile>(mapToLoad)->PopulateWorld(m_World);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create system pipeline
|
// Create system pipeline
|
||||||
m_SystemPipeline = new SystemPipeline(m_EventBroker);
|
m_SystemPipeline = new SystemPipeline(m_EventBroker);
|
||||||
m_SystemPipeline->AddSystem<PlayerSystem>(0);
|
m_SystemPipeline->AddSystem<PlayerSystem>(0);
|
||||||
m_SystemPipeline->AddSystem<HealthSystem>(0);
|
m_SystemPipeline->AddSystem<HealthSystem>(0);
|
||||||
|
|
||||||
|
if (!mapToLoad.empty()) {
|
||||||
|
auto file = ResourceManager::Load<EntityFile>(mapToLoad);
|
||||||
|
EntityFilePreprocessor fpp(file);
|
||||||
|
fpp.RegisterComponents(m_World);
|
||||||
|
EntityFileParser fp(file);
|
||||||
|
fp.MergeEntities(m_World);
|
||||||
|
}
|
||||||
|
|
||||||
//The Test
|
//The Test
|
||||||
//create entity which has transform,player,model,health in it. i.e. is a player
|
//create entity which has transform,player,model,health in it. i.e. is a player
|
||||||
EntityID playerID = m_World->CreateEntity();
|
EntityID playerID = m_World->CreateEntity();
|
||||||
m_PlayerID = playerID;
|
m_PlayerID = playerID;
|
||||||
ComponentWrapper health = m_World->AttachComponent(playerID, "Health");
|
|
||||||
ComponentWrapper& player = m_World->AttachComponent(playerID, "Player");
|
ComponentWrapper& player = m_World->AttachComponent(playerID, "Player");
|
||||||
|
ComponentWrapper health = m_World->AttachComponent(playerID, "Health");
|
||||||
//attach 2x weaps
|
//attach 2x weaps
|
||||||
ComponentWrapper& pItem = m_World->AttachComponent(playerID, "PrimaryItem");
|
ComponentWrapper& pItem = m_World->AttachComponent(playerID, "PrimaryItem");
|
||||||
ComponentWrapper& sItem = m_World->AttachComponent(playerID, "SecondaryItem");
|
ComponentWrapper& sItem = m_World->AttachComponent(playerID, "SecondaryItem");
|
||||||
@@ -148,47 +153,47 @@ ShootEventTest::~ShootEventTest()
|
|||||||
void ShootEventTest::TestSetup1(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
void ShootEventTest::TestSetup1(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
||||||
{
|
{
|
||||||
//set currentweap
|
//set currentweap
|
||||||
player["EquippedItem"] = 1.0;
|
player["EquippedItem"] = 1;
|
||||||
//set ammo set cooldown
|
//set ammo set cooldown
|
||||||
pItem["Ammo"] = 100.0;
|
pItem["Ammo"] = 100;
|
||||||
pItem["CoolDownTimer"] = 0.0;
|
pItem["CoolDownTimer"] = 0.0;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSetup2(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
void ShootEventTest::TestSetup2(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
||||||
{
|
{
|
||||||
//set currentweap
|
//set currentweap
|
||||||
player["EquippedItem"] = 2.0;
|
player["EquippedItem"] = 2;
|
||||||
//set ammo set cooldown
|
//set ammo set cooldown
|
||||||
sItem["Ammo"] = 10.0;
|
sItem["Ammo"] = 10;
|
||||||
sItem["CoolDownTimer"] = 0.0;
|
sItem["CoolDownTimer"] = 0.0;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSetup3(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
void ShootEventTest::TestSetup3(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
||||||
{
|
{
|
||||||
player["EquippedItem"] = 0.0;
|
player["EquippedItem"] = 0;
|
||||||
pItem["Ammo"] = 100.0;
|
pItem["Ammo"] = 100;
|
||||||
sItem["Ammo"] = 100.0;
|
sItem["Ammo"] = 100;
|
||||||
//TestSucceeded will be set to false if ammo changes during the 100 loops
|
//TestSucceeded will be set to false if ammo changes during the 100 loops
|
||||||
TestSucceeded = true;
|
TestSucceeded = true;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSetup4(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
void ShootEventTest::TestSetup4(ComponentWrapper &player, ComponentWrapper &pItem, ComponentWrapper &sItem)
|
||||||
{
|
{
|
||||||
//set currentweap
|
//set currentweap
|
||||||
player["EquippedItem"] = 1.0;
|
player["EquippedItem"] = 1;
|
||||||
//set ammo set cooldown
|
//set ammo set cooldown
|
||||||
pItem["Ammo"] = 100.0;
|
pItem["Ammo"] = 100;
|
||||||
pItem["CoolDownTimer"] = 5.0;
|
pItem["CoolDownTimer"] = 5.0;
|
||||||
//TestSucceeded will be set to false if ammo changes during the 100 loops
|
//TestSucceeded will be set to false if ammo changes during the 100 loops
|
||||||
TestSucceeded = true;
|
TestSucceeded = true;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSuccess1() {
|
void ShootEventTest::TestSuccess1() {
|
||||||
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
||||||
double currentAmmo = m_World->GetComponent(m_PlayerID, "PrimaryItem")["Ammo"];
|
int currentAmmo = m_World->GetComponent(m_PlayerID, "PrimaryItem")["Ammo"];
|
||||||
if (currentAmmo == 99.0)
|
if (currentAmmo == 99)
|
||||||
TestSucceeded = true;
|
TestSucceeded = true;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSuccess2() {
|
void ShootEventTest::TestSuccess2() {
|
||||||
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
||||||
double currentAmmo = m_World->GetComponent(m_PlayerID, "SecondaryItem")["Ammo"];
|
int currentAmmo = m_World->GetComponent(m_PlayerID, "SecondaryItem")["Ammo"];
|
||||||
if (currentAmmo == 9.0)
|
if (currentAmmo == 9)
|
||||||
TestSucceeded = true;
|
TestSucceeded = true;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSuccess3() {
|
void ShootEventTest::TestSuccess3() {
|
||||||
@@ -199,9 +204,9 @@ void ShootEventTest::TestSuccess3() {
|
|||||||
eMouseRelease.Y = 1.0f;
|
eMouseRelease.Y = 1.0f;
|
||||||
m_EventBroker->Publish(eMouseRelease);
|
m_EventBroker->Publish(eMouseRelease);
|
||||||
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
||||||
double currentAmmo = m_World->GetComponent(m_PlayerID, "PrimaryItem")["Ammo"];
|
int currentAmmo = m_World->GetComponent(m_PlayerID, "PrimaryItem")["Ammo"];
|
||||||
double currentAmmoSecondary = m_World->GetComponent(m_PlayerID, "SecondaryItem")["Ammo"];
|
int currentAmmoSecondary = m_World->GetComponent(m_PlayerID, "SecondaryItem")["Ammo"];
|
||||||
if (currentAmmo != 100.0 || currentAmmoSecondary != 100.0)
|
if (currentAmmo != 100 || currentAmmoSecondary != 100)
|
||||||
TestSucceeded = false;
|
TestSucceeded = false;
|
||||||
}
|
}
|
||||||
void ShootEventTest::TestSuccess4() {
|
void ShootEventTest::TestSuccess4() {
|
||||||
@@ -212,8 +217,8 @@ void ShootEventTest::TestSuccess4() {
|
|||||||
eMouseRelease.Y = 1.0f;
|
eMouseRelease.Y = 1.0f;
|
||||||
m_EventBroker->Publish(eMouseRelease);
|
m_EventBroker->Publish(eMouseRelease);
|
||||||
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
//if ammocount reaches -- we know the test has succeeded, i.e. a shot has been fired
|
||||||
double currentAmmo = m_World->GetComponent(m_PlayerID, "PrimaryItem")["Ammo"];
|
int currentAmmo = m_World->GetComponent(m_PlayerID, "PrimaryItem")["Ammo"];
|
||||||
if (currentAmmo != 100.0)
|
if (currentAmmo != 100)
|
||||||
TestSucceeded = false;
|
TestSucceeded = false;
|
||||||
}
|
}
|
||||||
void ShootEventTest::Tick()
|
void ShootEventTest::Tick()
|
||||||
|
|||||||
@@ -9,10 +9,14 @@
|
|||||||
#include "Input/KeyboardInputHandler.h"
|
#include "Input/KeyboardInputHandler.h"
|
||||||
#include "Input/MouseInputHandler.h"
|
#include "Input/MouseInputHandler.h"
|
||||||
#include "Core/EKeyDown.h"
|
#include "Core/EKeyDown.h"
|
||||||
#include "Core/EntityXMLFile.h"
|
#include "Core/EntityFile.h"
|
||||||
#include "Core/SystemPipeline.h"
|
#include "Core/SystemPipeline.h"
|
||||||
#include "PlayerSystem.h"
|
#include "PlayerSystem.h"
|
||||||
|
|
||||||
|
#include "Core/EntityFilePreprocessor.h"
|
||||||
|
#include "Core/EntityFileParser.h"
|
||||||
|
#include "Core/EntityFileWriter.h"
|
||||||
|
|
||||||
#include "Core\EMouseRelease.h"
|
#include "Core\EMouseRelease.h"
|
||||||
#include "Core\EShoot.h"
|
#include "Core\EShoot.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user