From 7817003db8683b503f3c848b00c5cc6f5aa2f4ad Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Fri, 13 Dec 2013 11:06:03 +0100 Subject: [PATCH 1/2] updated h.files description, started with level concept --- Code/Game/GameLogic/AttatchmentMassDriver.h | 3 +++ Code/Game/GameLogic/AttatchmentSocket.h | 4 ++++ Code/Game/GameLogic/GameLogic.vcxproj | 2 -- Code/Game/GameLogic/IAttatchment.h | 4 ++++ Code/Game/GameLogic/Level.cpp | 8 ++++++++ Code/Game/GameLogic/Level.h | 2 +- Code/Game/GameLogic/Weapon.cpp | 21 +++++++++++---------- 7 files changed, 31 insertions(+), 13 deletions(-) diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.h b/Code/Game/GameLogic/AttatchmentMassDriver.h index 879938fe..2fac7be4 100644 --- a/Code/Game/GameLogic/AttatchmentMassDriver.h +++ b/Code/Game/GameLogic/AttatchmentMassDriver.h @@ -1,3 +1,6 @@ +////////////////////////////////////////////////// +//Created by Erik of the GameLogic team +////////////////////////////////////////////////// #ifndef ATTATCHMENTMASSDRIVER_H #define ATTATCHMENTMASSDRIVER_H #include "IAttatchment.h" diff --git a/Code/Game/GameLogic/AttatchmentSocket.h b/Code/Game/GameLogic/AttatchmentSocket.h index f9be588b..2257dd7a 100644 --- a/Code/Game/GameLogic/AttatchmentSocket.h +++ b/Code/Game/GameLogic/AttatchmentSocket.h @@ -1,3 +1,7 @@ +////////////////////////////////////////////////// +//Created by Erik of the GameLogic team +////////////////////////////////////////////////// + #ifndef ATTATCHMENTSOCKET_H #define ATTATCHMENTSOCKET_H #include "IAttatchment.h" diff --git a/Code/Game/GameLogic/GameLogic.vcxproj b/Code/Game/GameLogic/GameLogic.vcxproj index 13491d28..291d2cd0 100644 --- a/Code/Game/GameLogic/GameLogic.vcxproj +++ b/Code/Game/GameLogic/GameLogic.vcxproj @@ -168,7 +168,6 @@ - @@ -182,7 +181,6 @@ - diff --git a/Code/Game/GameLogic/IAttatchment.h b/Code/Game/GameLogic/IAttatchment.h index 0b6cb061..2192ffcf 100644 --- a/Code/Game/GameLogic/IAttatchment.h +++ b/Code/Game/GameLogic/IAttatchment.h @@ -1,3 +1,7 @@ +////////////////////////////////////////////////// +//Created by Erik of the GameLogic team +////////////////////////////////////////////////// + #ifndef IATTATCHMENT_H #define IATTATCHMENT_H #include "GameLogicStates.h" diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index 38865f63..835062c1 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -2,6 +2,7 @@ #include "StaticObject.h" #include "DynamicObject.h" #include "GameMode.h" +#include "Player.h" using namespace GameLogic; @@ -15,6 +16,8 @@ struct Level::PrivateData { } + Player *players; + int nrOfPlayers; StaticObject** staticObjects; int nrOfStaticObjects; @@ -37,4 +40,9 @@ Level::~Level(void) delete myData; } +void Level::InitiateLevel(std::string levelPath) +{ + +} + diff --git a/Code/Game/GameLogic/Level.h b/Code/Game/GameLogic/Level.h index 9c7adb1a..89f13af2 100644 --- a/Code/Game/GameLogic/Level.h +++ b/Code/Game/GameLogic/Level.h @@ -14,7 +14,7 @@ namespace GameLogic Level(void); ~Level(void); - void CreateBox(); + void InitiateLevel(std::string levelPath); private: struct PrivateData; diff --git a/Code/Game/GameLogic/Weapon.cpp b/Code/Game/GameLogic/Weapon.cpp index 4bf4311c..e620e0d6 100644 --- a/Code/Game/GameLogic/Weapon.cpp +++ b/Code/Game/GameLogic/Weapon.cpp @@ -9,9 +9,10 @@ struct Weapon::PrivateData PrivateData() { weaponState = WEAPON_STATE_IDLE; - SelectedAttatchment = 0; + selectedAttatchment = 0; currentNrOfAttatchments = 0; selectedSocketID = 0; + maxNrOfSockets = 0; } ~PrivateData() @@ -21,10 +22,10 @@ struct Weapon::PrivateData WEAPON_STATE weaponState; AttatchmentSocket **attatchmentSockets; - int MaxNrOfSockets; + int maxNrOfSockets; int currentNrOfAttatchments; - IAttatchment *SelectedAttatchment; + IAttatchment *selectedAttatchment; int selectedSocketID; }myData; @@ -37,7 +38,7 @@ Weapon::Weapon() Weapon::Weapon(int MaxNrOfSockets) { myData = new PrivateData(); - myData->MaxNrOfSockets = MaxNrOfSockets; + myData->maxNrOfSockets = MaxNrOfSockets; myData->attatchmentSockets = new AttatchmentSocket*[MaxNrOfSockets]; for (int i = 0; i < MaxNrOfSockets; i++) { @@ -56,7 +57,7 @@ Weapon::~Weapon(void) ********************************************************/ void Weapon::Use(const WEAPON_FIRE &fireInput) { - myData->SelectedAttatchment->UseAttatchment(fireInput); + myData->selectedAttatchment->UseAttatchment(fireInput); } /******************************************************** @@ -83,7 +84,7 @@ bool Weapon::IsReloading() bool Weapon::IsValidSocket(int socketID) { - if(socketID < myData->MaxNrOfSockets && socketID >= 0) + if(socketID < myData->maxNrOfSockets && socketID >= 0) { if (myData->attatchmentSockets[socketID]->GetAttatchment() != 0) { @@ -100,16 +101,16 @@ int Weapon::GetCurrentSocketID() } -void Weapon::AddNewAttatchment(IAttatchment *attatchment) +void Weapon::AddNewAttatchment(IAttatchment *attatchment, Player *owner) { - if(myData->currentNrOfAttatchments < myData->MaxNrOfSockets) + if(myData->currentNrOfAttatchments < myData->maxNrOfSockets) { myData->attatchmentSockets[myData->currentNrOfAttatchments]->SetAttatchment(attatchment); myData->currentNrOfAttatchments++; } } -void Weapon::SwitchAttatchment(IAttatchment *attatchment, int socketID) +void Weapon::SwitchAttatchment(IAttatchment *attatchment, int socketID, Player *owner) { if (IsValidSocket(socketID)) { @@ -129,7 +130,7 @@ void Weapon::SelectAttatchment(int socketID) { if (IsValidSocket(socketID)) { - myData->SelectedAttatchment = myData->attatchmentSockets[socketID]->GetAttatchment(); + myData->selectedAttatchment = myData->attatchmentSockets[socketID]->GetAttatchment(); myData->selectedSocketID = socketID; } From f1f9f4d20a1bc6d027d21a8dceb756952e54afb5 Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Fri, 13 Dec 2013 11:11:51 +0100 Subject: [PATCH 2/2] added include string in level.h --- Code/Game/GameLogic/Level.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Game/GameLogic/Level.h b/Code/Game/GameLogic/Level.h index 89f13af2..7177531b 100644 --- a/Code/Game/GameLogic/Level.h +++ b/Code/Game/GameLogic/Level.h @@ -3,6 +3,7 @@ ////////////////////////////////////////////////// #ifndef LEVEL_H #define LEVEL_H +#include namespace GameLogic {