CapturePointSystem now tracks and verifies if a capturePoint can be taken over. Also the time is changed faster the more players stand on the capturepoint (number*dt). Also took care of the problem when both teams have the same contested capturepoint.

Added variable in the CapturePoint component:  CapturePointNumber. This is needed since we cant know what capturepoint is next to be taken over otherwise.
Updated the CapturePointTest according to current CapturePointSystem
TODO: try to refactor code in CapturePointSystem
This commit is contained in:
verysecrethero
2016-01-13 11:41:01 +01:00
parent 3a1056a2c3
commit 7a8604bf2b
6 changed files with 91 additions and 19 deletions
+7 -1
View File
@@ -16,7 +16,7 @@
class CapturePointSystem : public PureSystem
{
public:
//TODO: on new map, destroy all info in the vectors
//WARNING: on new map, destroy all info in the vectors, as well as reset all variables (just make new?)
CapturePointSystem(EventBroker* eventBroker);
//updatecomponent
@@ -30,6 +30,12 @@ private:
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
bool WinnerWasFound = false;
//need to track these variables for the captureSystem to work as per design!
const int m_NotACapturePoint = 999;
int m_Team1NextPossibleCapturePoint = m_NotACapturePoint;
int m_Team2NextPossibleCapturePoint = m_NotACapturePoint;
int m_Team1HomeCapturePoint = m_NotACapturePoint;
int m_Team2HomeCapturePoint = m_NotACapturePoint;
//vectors which will keep track of enter/leave changes
std::vector<std::tuple<EntityID, EntityID>> m_ETriggerTouchVector;