separate command handling

This commit is contained in:
Luka Jankovic 2025-07-26 00:57:29 +02:00
parent 90db87bec9
commit 0be3768867
11 changed files with 143 additions and 52 deletions

View file

@ -24,7 +24,6 @@
#include <stdlib.h>
#include <string.h>
#include "kubo_char_arr.h"
#include "kubo_dynarray.h"
#include "kubo_wall.h"
@ -50,20 +49,10 @@ struct kubo_context {
struct kubo_wall_arr walls;
struct kubo_context_state_data state;
// KUBO_CONTEXT_COMMAND
struct kubo_char_arr command;
// KUBO_CONTEXT_WALL_SELECT
size_t wall_select_index;
};
typedef void (*kubo_command_function)(struct kubo_context *context);
struct kubo_command_data {
const char *input;
kubo_command_function function;
};
void kubo_context_init(struct kubo_context *context);
void kubo_context_cleanup(struct kubo_context *context);