Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Created by sotiris on 4/25/2017.
- //
- #ifndef GHOST_PLAYERMANUALY_H
- #define GHOST_PLAYERMANUALY_H
- #include "Player/Player.h"
- #include "Interfaces/MoveAble.h"
- #include "Move.h"
- #include <windows.h>
- #include "stdio.h"
- class playerManualy:public Player,public MoveAble {
- playerManualy():Player(){
- std::string name="Sotiris";
- std::string id="161075";
- };
- int getMove(char maze[5][5])override{
- HANDLE handle=GetStdHandle(STD_INPUT_HANDLE);
- SetConsoleMode(handle,ENABLE_PROCESSED_INPUT);
- CHAR buffer[10];
- DWORD nChars;
- ReadConsole(handle,buffer,10,&nChars,NULL);
- printf("User types%s:",buffer);
- getchar();
- int input=atoi(buffer);
- switch(input) {
- case 8 :
- return UP;
- case 2:
- return DOWN;
- case 4:
- return LEFT;
- case 6:
- return RIGHT;
- case 1:
- return STAND;
- case 3:
- return TELEPORT;
- }
- return STAND;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement