summaryrefslogtreecommitdiffstats
path: root/pacman-c++/constants.h
diff options
context:
space:
mode:
authortotycro <totycro@unknown-horizons.org>2011-04-04 22:02:31 +0200
committertotycro <totycro@unknown-horizons.org>2011-04-04 22:02:31 +0200
commiteef1d8ea60e3797ba261ebfe61a7d1e165069ed4 (patch)
treec10e397f58af5dafd0d450bb104fb3122bb611e2 /pacman-c++/constants.h
parent47ae4a32e6e81dabbd2784a4b3c9c4ad68076a50 (diff)
downloadfoop-eef1d8ea60e3797ba261ebfe61a7d1e165069ed4.tar.gz
foop-eef1d8ea60e3797ba261ebfe61a7d1e165069ed4.tar.bz2
foop-eef1d8ea60e3797ba261ebfe61a7d1e165069ed4.zip
Use only 1 color format for everything
Simple map parsing for Blocks and Bonus points
Diffstat (limited to 'pacman-c++/constants.h')
-rw-r--r--pacman-c++/constants.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/pacman-c++/constants.h b/pacman-c++/constants.h
index 278f2b3..a8907b1 100644
--- a/pacman-c++/constants.h
+++ b/pacman-c++/constants.h
@@ -4,20 +4,26 @@
4const unsigned int map_size[2] = { 20, 20 }; 4const unsigned int map_size[2] = { 20, 20 };
5const unsigned int field_size[2] = { 16, 16 }; 5const unsigned int field_size[2] = { 16, 16 };
6 6
7enum Color {
8 noColor = 0,
9 red = (1 << 0),
10 blue = (1 << 1),
11 green = (1 << 2),
12};
13
7// constants for data transmission to client 14// constants for data transmission to client
8namespace transmission { 15namespace transmission {
9 16
10 typedef unsigned int field_t; 17 typedef unsigned int field_t;
11 const field_t red = (1 << 0); 18 typedef unsigned int mask_t;
12 const field_t blue = (1 << 1);
13 const field_t green = (1 << 2);
14 19
15 const field_t box = (1 << 3); 20 const field_t block = (1 << 3);
16 const field_t foo = (1 << 4); 21 const field_t bonuspoint = (1 << 4);
22
23 const mask_t color_mask = noColor | red | blue | green;
24 const mask_t type_mask = block | bonuspoint;
17 25
18 typedef field_t** map_t; 26 typedef field_t** map_t;
19} 27}
20 28
21
22
23#endif // CONSTANTS_H \ No newline at end of file 29#endif // CONSTANTS_H \ No newline at end of file