|
@ -32,12 +32,30 @@ int handleCommand( char* input ){ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct command* createCommands(){ |
|
|
|
|
|
struct command commands[] = { |
|
|
|
|
|
{"\"start menu\" - startet das menu", startMenu} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
size_t numCommands = sizeof(commands) / sizeof(commands[0]); |
|
|
|
|
|
|
|
|
|
|
|
// Dynamischen Speicher für das Array von commands reservieren |
|
|
|
|
|
struct command* ptrCommands = (struct command*)malloc(numCommands * sizeof(struct command)); |
|
|
|
|
|
|
|
|
|
|
|
// Über das lokale Array iterieren und Daten kopieren |
|
|
|
|
|
for (size_t i = 0; i < numCommands; i++) { |
|
|
|
|
|
ptrCommands[i] = commands[i]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ptrCommands; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int startMenu(){ |
|
|
int startMenu(){ |
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int startGame(){ |
|
|
int startGame(){ |
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
return 1; |
|
|
} |
|
|
} |