diff --git a/src/main/c/Georg/tictactoe.c b/src/main/c/Georg/tictactoe.c index fcade80..ee0f8dc 100644 --- a/src/main/c/Georg/tictactoe.c +++ b/src/main/c/Georg/tictactoe.c @@ -8,7 +8,7 @@ void printBoard(); struct ticTacToe GAME; -struct command COMMANDS[MAX_COMMANDS] = { +struct usrCommand COMMANDS[MAX_COMMANDS] = { { 1, "\"start menu\" - startet das menu", startMenu}, { 2, "\"start game\" - startet das spiel", startGame} }; @@ -21,12 +21,12 @@ void startTicTacToe(){ GAME = createTicTacToe(); while( GAME.currentState != -1 ){ - commandFunction command; + commandFunction usrCommand; printf("search command!\n"); - command = getCommandById( GAME.currentState + 1); + usrCommand = getCommandById( GAME.currentState + 1); - if( command != NULL) - command(0); + if( usrCommand != NULL) + usrCommand(0); else{ printf("command not found"); return; @@ -105,7 +105,7 @@ int handleGameInput( char* input ){ } int startMenu( int code ){ - if( code == -1 ){ // command test + if( code == -1 ){ // usrCommand test return 1; } @@ -222,7 +222,7 @@ bool playerHasWon( bool board[BORAD_SIZE][BORAD_SIZE]){ } int startGame( int code ){ - if( code == -1 ){ // command test + if( code == -1 ){ // usrCommand test return 1; } diff --git a/src/main/c/Georg/tictactoe.h b/src/main/c/Georg/tictactoe.h index efd1d1e..59f90d9 100644 --- a/src/main/c/Georg/tictactoe.h +++ b/src/main/c/Georg/tictactoe.h @@ -15,14 +15,14 @@ struct ticTacToe{ // Typdefinition für einen Funktionszeiger typedef int (*commandFunction)( int ); -struct command{ +struct usrCommand{ int id; char* description; commandFunction fun; }; extern struct ticTacToe GAME; -extern struct command COMMANDS[MAX_COMMANDS]; +extern struct usrCommand COMMANDS[MAX_COMMANDS]; void startTicTacToe();