Fixed a few CodeStandard mistakes. Added CapturePointSystem to CMakeLists.txt since branch is no longer based on ShootEvent-branch
This commit is contained in:
@@ -29,7 +29,7 @@ private:
|
|||||||
EventRelay<CapturePointSystem, Events::TriggerLeave> m_ETriggerLeave;
|
EventRelay<CapturePointSystem, Events::TriggerLeave> m_ETriggerLeave;
|
||||||
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
|
||||||
|
|
||||||
bool WinnerWasFound = false;
|
bool m_WinnerWasFound = false;
|
||||||
//need to track these variables for the captureSystem to work as per design!
|
//need to track these variables for the captureSystem to work as per design!
|
||||||
const int m_NotACapturePoint = 999;
|
const int m_NotACapturePoint = 999;
|
||||||
int m_Team1NextPossibleCapturePoint = m_NotACapturePoint;
|
int m_Team1NextPossibleCapturePoint = m_NotACapturePoint;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ set(SOURCE_FILES
|
|||||||
"Game.cpp"
|
"Game.cpp"
|
||||||
"HealthSystem.cpp"
|
"HealthSystem.cpp"
|
||||||
"PlayerSystem.cpp"
|
"PlayerSystem.cpp"
|
||||||
|
"CapturePointSystem.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIBRARIES
|
set(LIBRARIES
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ CapturePointSystem::CapturePointSystem(EventBroker* eventBroker)
|
|||||||
|
|
||||||
//here all capturepoints will update their component
|
//here all capturepoints will update their component
|
||||||
//NOTE: needs to run each frame, since we're possibly modifying the captureTimer for the capturePoints by dt
|
//NOTE: needs to run each frame, since we're possibly modifying the captureTimer for the capturePoints by dt
|
||||||
void CapturePointSystem::UpdateComponent(World *world, ComponentWrapper &capturePoint, double dt)
|
void CapturePointSystem::UpdateComponent(World* world, ComponentWrapper& capturePoint, double dt)
|
||||||
{
|
{
|
||||||
//for testing only:
|
//for testing only:
|
||||||
//dt = 20.0;
|
//dt = 20.0;
|
||||||
@@ -140,13 +140,13 @@ void CapturePointSystem::UpdateComponent(World *world, ComponentWrapper &capture
|
|||||||
}
|
}
|
||||||
|
|
||||||
//WIN: check for possible winCondition = check if the homebase is owned by the other team
|
//WIN: check for possible winCondition = check if the homebase is owned by the other team
|
||||||
if (!WinnerWasFound && (int)capturePoint["OwnedBy"] != 0 && (int)capturePoint["IsHomeCapturePointForTeamNumber"] != 0 &&
|
if (!m_WinnerWasFound && (int)capturePoint["OwnedBy"] != 0 && (int)capturePoint["IsHomeCapturePointForTeamNumber"] != 0 &&
|
||||||
(int)capturePoint["IsHomeCapturePointForTeamNumber"] != (int)capturePoint["OwnedBy"]) {
|
(int)capturePoint["IsHomeCapturePointForTeamNumber"] != (int)capturePoint["OwnedBy"]) {
|
||||||
//publish Win event
|
//publish Win event
|
||||||
Events::Win e;
|
Events::Win e;
|
||||||
e.TeamThatWon = capturePoint["OwnedBy"];
|
e.TeamThatWon = capturePoint["OwnedBy"];
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
WinnerWasFound = true;
|
m_WinnerWasFound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user