#include #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; } }