From b7f48f25aa4d5397b2841663ddb17d9f79b64c00 Mon Sep 17 00:00:00 2001 From: KaffeeMaus Date: Fri, 26 Jan 2024 11:32:49 +0100 Subject: [PATCH] added an id to gameCommands --- src/main/c/Georg/tictactoe.c | 4 ++-- src/main/c/Georg/tictactoe.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/c/Georg/tictactoe.c b/src/main/c/Georg/tictactoe.c index bff2f1c..6eaa000 100644 --- a/src/main/c/Georg/tictactoe.c +++ b/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]); diff --git a/src/main/c/Georg/tictactoe.h b/src/main/c/Georg/tictactoe.h index d8c22f2..077ef48 100644 --- a/src/main/c/Georg/tictactoe.h +++ b/src/main/c/Georg/tictactoe.h @@ -9,6 +9,7 @@ struct ticTacToe{ typedef int (*commandFunction)(); struct command{ + int id; char* description; commandFunction fun; };