summaryrefslogtreecommitdiff
path: root/src/net/client.c
diff options
context:
space:
mode:
authorMario Kilies <MarioKilies@GMX.net>2011-01-25 13:28:15 +0100
committerMario Kilies <MarioKilies@GMX.net>2011-01-25 13:28:15 +0100
commitec98567cc51fa1d559cf1fe076898b6537053499 (patch)
treedfc07fa64a412f6ce1fa0701dc1ce5e9eacf82e7 /src/net/client.c
parent52f95177eb8050f073a3d65413feb16cfce93baa (diff)
Minor changes. Renamed global.[ch] to data_store.[ch], data_store to data_store_t and datamodel() to data_store().
Diffstat (limited to 'src/net/client.c')
-rw-r--r--src/net/client.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/net/client.c b/src/net/client.c
index 7f1f98a..ae0c828 100644
--- a/src/net/client.c
+++ b/src/net/client.c
@@ -7,7 +7,7 @@
#include <unistd.h>
#include <assert.h>
#include "client.h"
-#include "../global.h"
+#include "../data_store.h"
#include "../player.h"
#include "../game.h"
@@ -66,7 +66,7 @@ bool client_parse_player_list(const msg_t *m)
{
assert(m != NULL);
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
uint32_t pos = 0;
ds->player_list.count = m->payload[pos++];
@@ -91,7 +91,7 @@ bool client_parse_deal_hand(const msg_t *m)
assert(m != NULL);
assert(m->hdr.payload_length == MAX_HAND_CARDS); // deal_cards packet have fixed size
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
for(int i=0; i<MAX_HAND_CARDS; i++)
ds->hand.cards[i] = m->payload[i];
@@ -104,7 +104,7 @@ bool client_parse_selected_stack(const msg_t *m)
assert(m != NULL);
assert(m->hdr.payload_length == 1);
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
ds->stack_index = m->payload[0];
assert(ds->stack_index <= NUM_TABLE_STACKS);
@@ -117,7 +117,7 @@ bool client_parse_initial_stacks(const msg_t *m)
assert(m != NULL);
assert(m->hdr.payload_length == NUM_TABLE_STACKS);
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
for(int i=0; i<NUM_TABLE_STACKS; i++)
ds->table_stacks.stacks[i].cards[0] = m->payload[i];
@@ -129,7 +129,7 @@ bool client_parse_selected_card_all(const msg_t *m)
assert(m != NULL);
assert(m->hdr.payload_length % 2 == 0); // payload: n times id+card
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
for(int i=0; i<m->hdr.payload_length; i+=2)
{
player_id_t pid = m->payload[i];
@@ -142,7 +142,7 @@ bool client_parse_selected_card_all(const msg_t *m)
void client_prep_hello(msg_t *m)
{
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
uint8_t namelen = strlen(ds->nickname);
m->hdr.type = msg_type_hello;
memcpy(m->payload, ds->nickname, namelen);
@@ -151,7 +151,7 @@ void client_prep_hello(msg_t *m)
void client_prep_selected_card(msg_t *m)
{
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
card c = ds->selected_card;
assert(c >= MIN_CARD && c <= MAX_CARD);
@@ -162,7 +162,7 @@ void client_prep_selected_card(msg_t *m)
void client_prep_selected_stack(msg_t *m)
{
- data_store* ds = datamodel();
+ data_store_t *ds = data_store();
assert(ds->stack_index <= NUM_TABLE_STACKS);
m->hdr.type = msg_type_selected_stack_c;