Put all LifeStuff into a new LifeSystem. Appears to be working.

This commit is contained in:
PlatinumSkink
2015-10-22 10:34:22 +02:00
parent 1a6f18da94
commit 59c23026d2
6 changed files with 186 additions and 70 deletions
+4 -10
View File
@@ -10,14 +10,17 @@
#include "Core/CTemplate.h"
#include "Core/ResourceManager.h"
#include "Core/ConfigFile.h"
#include "Physics/CPhysics.h"
#include "Physics/CCircleShape.h"
#include "Physics/CRectangleShape.h"
#include "Physics/EContact.h"
#include "Rendering/CModel.h"
#include "Rendering/CSprite.h"
#include "Rendering/CPointLight.h"
#include "Rendering/CAnimation.h"
#include "Game/CBall.h"
#include "Game/CPowerUp.h"
#include "Game/CLife.h"
@@ -43,6 +46,7 @@
#include "Game/EHitLag.h"
#include "Game/EActionButton.h"
#include "Game/ELifebuoyHit.h"
#include "Physics/ECreateParticleSequence.h"
#include "Sound/CCollisionSound.h"
@@ -79,7 +83,6 @@ public:
void OnEntityRemoved(EntityID entity) override;
EntityID CreateBall();
void CreateLife(int);
EntityID Ball() { return m_Ball; };
void SetBall(const EntityID& ball) { m_Ball = ball; }
@@ -91,10 +94,6 @@ public:
void SetEdgeY(const float& edgeY) { m_EdgeY = edgeY; }
int& MultiBalls() { return m_MultiBalls; }
void SetMultiBalls(const int& multiBalls) { m_MultiBalls = multiBalls; }
int& Lives() { return m_Lives; }
void SetLives(const int& lives) { m_Lives = lives; }
int& PastLives() { return m_PastLives; }
void SetPastLives(const int& pastLives) { m_PastLives = pastLives; }
bool ReplaceBall() const { return m_ReplaceBall; }
void SetReplaceBall(const bool& replaceBall) { m_ReplaceBall = replaceBall; }
bool IsPaused() const { return m_Pause; }
@@ -107,8 +106,6 @@ private:
float m_EdgeX = 3.4f; //Actually 3.2, but anyways.
float m_EdgeY = 5.2f;
int m_MultiBalls = 0;
int m_Lives = 3;
int m_PastLives = 3;
bool m_ReplaceBall = false;
bool m_Pause = false;
bool m_Waiting = true;
@@ -120,7 +117,6 @@ private:
double m_KrakenCharge = 0;
bool m_Restarting = false;
int m_StickyCounter = 3;
bool m_GodMode = false;
bool m_First = true;
@@ -134,7 +130,6 @@ private:
std::unordered_map<EntityID, std::list<glm::vec2>> m_Contacts;
void ResolveContacts();
dd::EventRelay<BallSystem, dd::Events::LifeLost> m_ELifeLost;
dd::EventRelay<BallSystem, dd::Events::MultiBallLost> m_EMultiBallLost;
dd::EventRelay<BallSystem, dd::Events::ResetBall> m_EResetBall;
dd::EventRelay<BallSystem, dd::Events::MultiBall> m_EMultiBall;
@@ -151,7 +146,6 @@ private:
dd::EventRelay<BallSystem, dd::Events::ArrivedAtNewStage> m_EArrivedAtNewStage;
bool Contact(const Events::Contact &event);
bool OnLifeLost(const dd::Events::LifeLost &event);
bool OnMultiBallLost(const dd::Events::MultiBallLost &event);
bool OnResetBall(const dd::Events::ResetBall &event);
bool OnMultiBall(const dd::Events::MultiBall &event);