summaryrefslogtreecommitdiff
path: root/src/global.c
blob: d2c0804f0d79061b36b15671107fc6747edbe1ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#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;
	}
}