diff --git a/Engine/headers/CommandParser.h b/Engine/headers/CommandParser.h index e9d239a..01de049 100644 --- a/Engine/headers/CommandParser.h +++ b/Engine/headers/CommandParser.h @@ -22,13 +22,6 @@ public: std::vector Verb(std::stringstream &sentences); std::vector Noun(std::stringstream &sentences); - inline friend void swap(CommandParser& lhs, CommandParser& rhs) - { - using std::swap; - swap(lhs.commands, rhs.commands); - } - - static inline void CommandUnrecognized() { printf("I don't know how to do that.\n"); } int Parse(); }; diff --git a/Engine/headers/game.h b/Engine/headers/game.h index 1c3b68b..36dc1ee 100644 --- a/Engine/headers/game.h +++ b/Engine/headers/game.h @@ -38,8 +38,6 @@ private: public: Game(); - Game(Game& rhs); - Game& operator=(Game& rhs); inline bool GetIsActive() const { return isActive; } bool Init(); @@ -66,13 +64,8 @@ public: return *game_; } - inline friend void swap(Game &lhs, Game &rhs) - { - using std::swap; - swap(lhs.isActive, rhs.isActive); - swap(lhs.progress, rhs.progress); - swap(lhs.player, rhs.player); - swap(lhs.parser, rhs.parser); + static void SetGameInstance(Game * g) { + game_ = g; } ~Game(); diff --git a/Engine/src/game.cpp b/Engine/src/game.cpp index b39676b..0656966 100644 --- a/Engine/src/game.cpp +++ b/Engine/src/game.cpp @@ -49,17 +49,6 @@ bool Game::Init() { return true; } -Game::Game(Game &rhs) -{ - player = rhs.player; - progress = rhs.progress; -} - -Game& Game::operator=(Game &rhs) -{ - swap(*this, rhs); - return *this; -} void Game::Run() { while (isActive) { @@ -83,6 +72,7 @@ void Game::ChangeRoom(Room r) { } int Quit(const std::string &n) { + printf("Bye Bye! \nb"); Game::Instance().SetIsActive(false); return 0; } diff --git a/main.cpp b/main.cpp index 4403e1b..e075dd2 100644 --- a/main.cpp +++ b/main.cpp @@ -4,7 +4,8 @@ int main(int argc, char *argv[]) { Game game; // Calls default constructor which Initializes GAME if (!game) { - game = Game::Instance(); + game.Init(); + Game::SetGameInstance(&game); } while (game.GetIsActive()) { game.Run();