Browse Source

added an id to gameCommands

remotes/origin/georg
KaffeeMaus 11 months ago
parent
commit
b7f48f25aa
  1. 4
      src/main/c/Georg/tictactoe.c
  2. 1
      src/main/c/Georg/tictactoe.h

4
src/main/c/Georg/tictactoe.c

@ -34,8 +34,8 @@ int handleCommand( char* input ){
struct command* createCommands(){
struct command commands[] = {
{"\"start menu\" - startet das menu", startMenu},
{"\"start game\" - startet das spiel", startGame}
{ 1, "\"start menu\" - startet das menu", startMenu},
{ 2, "\"start game\" - startet das spiel", startGame}
};
size_t numCommands = sizeof(commands) / sizeof(commands[0]);

1
src/main/c/Georg/tictactoe.h

@ -9,6 +9,7 @@ struct ticTacToe{
typedef int (*commandFunction)();
struct command{
int id;
char* description;
commandFunction fun;
};

Loading…
Cancel
Save