#pragma once #pragma comment(lib, "ws2_32.lib") #include #include using namespace std; #include "TTTPlayer.h" #include "TTTModel.h" #include "TTTViewConsole.h" //#define DEBUG #define SERIAL_LINK //#define SOCKET_LINK #ifdef SERIAL_LINK #include "TTTSerialCommunication.h" #elif defined SOCKET_LINK #include "TTTSocketCommunication.h" #endif #define MAXMOVES 9 class TTTController { TTTModel *model; TTTViewConsole *view; #ifdef SERIAL_LINK TTTSerialCommunication *comm; #elif defined SOCKET_LINK TTTSocketCommunication *comm; #endif TTTPlayer players[2]; bool master; //Player1 = 0, Player 2 = 1 int beginningplayer; //von 1 bis max. 9 int movenumber; void clrscr(void); void gotoXY(int x, int y); int setPlayerData(string n1, string n2); int getBeginningPlayer(void); int getMoveNumber(void); int place(int x, int y, Fieldvalue f); bool detectMaster(void); public: TTTController(void); ~TTTController(void); string startGame(void); };