summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-04-30 09:11:20 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-04-30 09:11:20 +0200
commit4b5f429c0d0f369c72ddd0b290769bf61ea83601 (patch)
tree27719bf8c2ad32c3cb51f4777da9f1712b7e15ee
parentfa88c91351388c4b2e1791ccab2cd8a959dc976b (diff)
Change controller name
-rw-r--r--src/Controller/ConsoleController/ConsoleController.cpp26
-rw-r--r--src/Controller/ConsoleController/ConsoleController.hpp14
2 files changed, 20 insertions, 20 deletions
diff --git a/src/Controller/ConsoleController/ConsoleController.cpp b/src/Controller/ConsoleController/ConsoleController.cpp
index 44b598e..2231213 100644
--- a/src/Controller/ConsoleController/ConsoleController.cpp
+++ b/src/Controller/ConsoleController/ConsoleController.cpp
@@ -1,48 +1,48 @@
-#include "CTConsole.hpp"
+#include "ConsoleController.hpp"
-CTConsole::CTConsole()
+ConsoleController::ConsoleController()
{
m_game = new Game();
}
-CTConsole::~CTConsole()
+ConsoleController::~ConsoleController()
{
delete m_game;
}
-void CTConsole::play()
+void ConsoleController::play()
{
while (!m_game->isOver())
{
m_game->showGrid();
char moveChoice = ' ';
-
+
std::cin >> moveChoice;
-
+
switch (moveChoice)
{
case 'z':
std::cout << "up" << std::endl;
break;
-
+
case 's':
std::cout << "down" << std::endl;
break;
-
+
case 'q':
std::cout << "left" << std::endl;
break;
-
+
case 'd':
std::cout << "right" << std::endl;
break;
-
+
default:
break;
}
-
+
std::cout << std::endl;
-
+
m_game->pop();
}
-} \ No newline at end of file
+}
diff --git a/src/Controller/ConsoleController/ConsoleController.hpp b/src/Controller/ConsoleController/ConsoleController.hpp
index 9534877..83c44fc 100644
--- a/src/Controller/ConsoleController/ConsoleController.hpp
+++ b/src/Controller/ConsoleController/ConsoleController.hpp
@@ -9,18 +9,18 @@
#include <iostream>
-#include "../Model/Game.hpp"
+#include "../../Model/Game.hpp"
-class CTConsole
+class ConsoleController
{
private:
Game * m_game;
-
+
public:
- CTConsole();
- ~CTConsole();
-
+ ConsoleController();
+ ~ConsoleController();
+
void play();
};
-#endif \ No newline at end of file
+#endif