From 42787dcb69cddb8cbdd723f6ac154d64c2d442b9 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 24 Jun 2013 09:13:27 +1000 Subject: [PATCH 1/2] Explicitly deleted copy and move constructors --- client/scene_manager.hpp | 2 ++ server/server_application.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/client/scene_manager.hpp b/client/scene_manager.hpp index d2d4310..214a91d 100644 --- a/client/scene_manager.hpp +++ b/client/scene_manager.hpp @@ -44,6 +44,8 @@ public: void Proc(); void Quit(); + SceneManager(SceneManager const&) = delete; + SceneManager(SceneManager const&&) = delete; private: /* Private access members */ void LoadScene(SceneList sceneIndex); diff --git a/server/server_application.hpp b/server/server_application.hpp index 02c849e..4190f76 100644 --- a/server/server_application.hpp +++ b/server/server_application.hpp @@ -68,6 +68,7 @@ public: void Quit(); ServerApplication(ServerApplication const&) = delete; + ServerApplication(ServerApplication const&&) = delete; private: //game loop void UpdateWorld(double delta); From ddb93cfcf16415921c8128884243d0e81ef02359 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 24 Jun 2013 09:22:43 +1000 Subject: [PATCH 2/2] Changed the name of the client's main class --- ...cene_manager.cpp => client_application.cpp} | 18 +++++++++--------- ...cene_manager.hpp => client_application.hpp} | 14 +++++++------- client/main.cpp | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) rename client/{scene_manager.cpp => client_application.cpp} (92%) rename client/{scene_manager.hpp => client_application.hpp} (87%) diff --git a/client/scene_manager.cpp b/client/client_application.cpp similarity index 92% rename from client/scene_manager.cpp rename to client/client_application.cpp index dfc2c6c..d107b1c 100644 --- a/client/scene_manager.cpp +++ b/client/client_application.cpp @@ -19,7 +19,7 @@ * 3. This notice may not be removed or altered from any source * distribution. */ -#include "scene_manager.hpp" +#include "client_application.hpp" #include #include @@ -40,15 +40,15 @@ //Public access members //------------------------- -SceneManager::SceneManager() { +ClientApplication::ClientApplication() { // } -SceneManager::~SceneManager() { +ClientApplication::~ClientApplication() { UnloadScene(); } -/* SceneManager::Init() +/* ClientApplication::Init() * This function initializes the entire program. There are a number of things * that could go wrong here, which is why there is such an unusual order of * operations. @@ -59,7 +59,7 @@ SceneManager::~SceneManager() { * The ConfigUtility's call to Load() also ensures that the "rsc\" folder is in the directory. It's easy to forget it. */ -void SceneManager::Init() { +void ClientApplication::Init() { //load the config file try { configUtil->Load("rsc/config.cfg"); @@ -92,7 +92,7 @@ void SceneManager::Init() { netUtil->Open(0, sizeof(Packet)); } -void SceneManager::Proc() { +void ClientApplication::Proc() { LoadScene(SceneList::FIRST); //prepare the time system @@ -130,7 +130,7 @@ void SceneManager::Proc() { UnloadScene(); } -void SceneManager::Quit() { +void ClientApplication::Quit() { //clean up the singletons netUtil->Close(); surfaceMgr->FreeAll(); @@ -147,7 +147,7 @@ void SceneManager::Quit() { //Private access members //------------------------- -void SceneManager::LoadScene(SceneList sceneIndex) { +void ClientApplication::LoadScene(SceneList sceneIndex) { UnloadScene(); switch(sceneIndex) { @@ -177,7 +177,7 @@ void SceneManager::LoadScene(SceneList sceneIndex) { } } -void SceneManager::UnloadScene() { +void ClientApplication::UnloadScene() { delete activeScene; activeScene = nullptr; } diff --git a/client/scene_manager.hpp b/client/client_application.hpp similarity index 87% rename from client/scene_manager.hpp rename to client/client_application.hpp index 214a91d..16d2be0 100644 --- a/client/scene_manager.hpp +++ b/client/client_application.hpp @@ -19,8 +19,8 @@ * 3. This notice may not be removed or altered from any source * distribution. */ -#ifndef SCENEMANAGER_HPP_ -#define SCENEMANAGER_HPP_ +#ifndef CLIENTAPPLICATION_HPP_ +#define CLIENTAPPLICATION_HPP_ #include "scene_list.hpp" #include "base_scene.hpp" @@ -34,18 +34,18 @@ #include "SDL/SDL.h" -class SceneManager { +class ClientApplication { public: /* Public access members */ - SceneManager(); - ~SceneManager(); + ClientApplication(); + ~ClientApplication(); void Init(); void Proc(); void Quit(); - SceneManager(SceneManager const&) = delete; - SceneManager(SceneManager const&&) = delete; + ClientApplication(ClientApplication const&) = delete; + ClientApplication(ClientApplication const&&) = delete; private: /* Private access members */ void LoadScene(SceneList sceneIndex); diff --git a/client/main.cpp b/client/main.cpp index 7a76519..b314e2b 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -19,7 +19,7 @@ * 3. This notice may not be removed or altered from any source * distribution. */ -#include "scene_manager.hpp" +#include "client_application.hpp" #include #include @@ -31,7 +31,7 @@ int main(int, char**) { cout << "Beginning program" << endl; #endif try { - SceneManager app; + ClientApplication app; app.Init(); app.Proc(); app.Quit();