From c5826edc22894af945509905eeb7a155b8ce2d87 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sun, 23 Jan 2011 16:52:32 +0100 Subject: added global data store and update function --- src/global.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/global.c (limited to 'src/global.c') diff --git a/src/global.c b/src/global.c new file mode 100644 index 0000000..d9dc3bf --- /dev/null +++ b/src/global.c @@ -0,0 +1,36 @@ +#include +#include +#include "global.h" + +static data_store* data = NULL; + +// returns global data_store +data_store* datamodel() +{ + if(data == NULL) + { + data = malloc(sizeof(data_store)); + memset(data, 0, sizeof(data_store)); + } + + return data; +} + +// indicate which part of model has been changed, +// so UI can be redrawn +void updated_model(update_type_t action) +{ + switch(action) + { + case update_type_players: + // ui_redraw_player_list() + break; + case update_type_stacks: + // ui_redraw_stacks() + break; + case update_type_hand: + // ui_redraw_hand() + break; + } +} + -- cgit v1.2.3