StyleGuide Fix

This commit is contained in:
PlatinumSkink
2015-09-15 18:48:26 +02:00
parent 990f31d120
commit 5ee5400a28
8 changed files with 128 additions and 134 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Components
struct Ball : Component
{
int number = 0;
int Number = 0;
};
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Components
struct Life : Component {
int number = 0;
int Number = 0;
};
+3 -3
View File
@@ -20,9 +20,9 @@ struct Pad : Component
int Lives;
int Points;
float slowdownModifier = 5.f;
float accelerationSpeed = 80.f;
float maxSpeed = 40.f;
float SlowdownModifier = 5.f;
float AccelerationSpeed = 80.f;
float MaxSpeed = 40.f;
};
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Events
struct ScoreEvent : Event
{
int score = 0;
int Score = 0;
};
}
+29 -13
View File
@@ -65,12 +65,38 @@ public:
void Update(double dt) override;
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
int lives = 3;
int pastLives = 3;
int score = 0;
bool Initialized() const { return m_Initialized; }
void SetInitialized(const bool& initialized) { m_Initialized = initialized; }
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; }
int& Score() { return m_Score; }
void SetScore(const int& score) { m_Score = score; }
int& NumberOfBricks() { return m_NumberOfBricks; }
void SetNumberOfBricks(const int& numberOfBricks) { m_NumberOfBricks = numberOfBricks; }
int& Rows() { return m_Rows; }
void SetRows(const int& rows) { m_Rows = rows; }
int& Lines() { return m_Lines; }
void SetLines(const int& lines) { m_Lines = lines; }
int& SpaceToEdge() { return m_SpaceToEdge; }
void SetSpaceToEdge(const int& spaceToEdge) { m_SpaceToEdge = spaceToEdge; }
glm::vec2& SpaceBetweenBricks() { return m_SpaceBetweenBricks; }
void SetSpaceBetweenBricks(const glm::vec2& spaceBetweenBricks) { m_SpaceBetweenBricks = spaceBetweenBricks; }
private:
bool m_Initialized = false;
int m_Lives = 3;
int m_PastLives = 3;
int m_Score = 0;
int m_NumberOfBricks;
int m_Rows = 7;
int m_Lines = 8;
int m_SpaceToEdge = 0;
glm::vec2 m_SpaceBetweenBricks = glm::vec2(2, 0.5);
dd::EventRelay<LevelSystem, dd::Events::Contact> m_EContact;
dd::EventRelay<LevelSystem, dd::Events::LifeLost> m_ELifeLost;
dd::EventRelay<LevelSystem, dd::Events::ScoreEvent> m_EScoreEvent;
@@ -78,16 +104,6 @@ private:
bool OnContact(const dd::Events::Contact &event);
bool LifeLost(const dd::Events::LifeLost &event);
bool ScoreEvent(const dd::Events::ScoreEvent &event);
bool m_Initialized = false;
int numberOfBricks;
int tRows = 7;
int tLines = 8;
glm::vec2 tSpaceBetweenBricks = glm::vec2(2, 0.5);
int tSpaceToEdge = 0;
EntityID entityToRemove = NULL;
};
}
+24 -13
View File
@@ -34,14 +34,36 @@ class PadSystem : public System
{
public:
PadSystem(World* world, std::shared_ptr<dd::EventBroker> eventBroker)
: System(world, eventBroker)
{ }
: System(world, eventBroker) { }
void Initialize() override;
void Update(double dt) override;
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
EntityID& Entity() { return m_Entity; }
void SetEntity(const EntityID& ent) { m_Entity = ent; }
glm::vec3 Acceleration() const { return m_Acceleration; }
void SetAcceleration(const glm::vec3& acceleration) { m_Acceleration = acceleration; }
bool Left() const { return m_Left; }
void SetLeft(const bool& left) { m_Left = left; }
bool Right() const { return m_Right; }
void SetRight(const bool& right) { m_Right = right; }
bool ReplaceBall() const { return m_ReplaceBall; }
void SetReplaceBall(const bool& replaceBall) { m_ReplaceBall = replaceBall; }
Components::Transform* Transform() const { return m_Transform; }
void SetTransform(const Components::Transform* transform) { m_Transform = transform; }
Components::Pad* Pad() const { return m_Pad; }
void SetPad(const Components::Pad* pad) { m_Pad = pad; }
private:
EntityID m_Entity = 0;
glm::vec3 m_Acceleration = glm::vec3(0.f, 0.f, 0.f);
bool m_Left = false, m_Right = false, m_ReplaceBall = false;
Components::Transform* m_Transform;
Components::Pad* m_Pad;
dd::EventRelay<PadSystem, dd::Events::KeyDown> m_EKeyDown;
dd::EventRelay<PadSystem, dd::Events::KeyUp> m_EKeyUp;
dd::EventRelay<PadSystem, dd::Events::Contact> m_EContact;
@@ -50,22 +72,11 @@ private:
bool OnKeyDown(const dd::Events::KeyDown &event);
bool OnKeyUp(const dd::Events::KeyUp &event);
bool OnContact(const dd::Events::Contact &event);
bool ResetBall(const dd::Events::ResetBall &event);
EntityID removeThisObject = NULL;
class PadSteeringInputController;
std::array<std::shared_ptr<PadSteeringInputController>, 4> m_PadInputControllers;
EntityID ent = 0;
Components::Transform* transform;
Components::Pad* pad;
glm::vec3 acceleration = glm::vec3(0.f, 0.f, 0.f);
bool left = false, right = false, replaceBall = false;
};
class PadSystem::PadSteeringInputController : InputController<PadSystem>