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* createCommands(){
struct command commands[] = { 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]); size_t numCommands = sizeof(commands) / sizeof(commands[0]);

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

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

Loading…
Cancel
Save