summaryrefslogtreecommitdiff
path: root/common/tile.h
blob: 6f836320b192de684ccbc700c7ef037ede82cb39 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef TILE_H
#define TILE_H

#include <stdint.h>
#include <vector>

class Tile {
	public:
		enum Type {
			// Face-down tile:
			Back,
			// Characters set:
			Man_1,
			Man_2,
			Man_3,
			Man_4,
			Man_5,
			Man_6,
			Man_7,
			Man_8,
			Man_9,
			// Circles set:
			Pin_1,
			Pin_2,
			Pin_3,
			Pin_4,
			Pin_5,
			Pin_6,
			Pin_7,
			Pin_8,
			Pin_9,
			// Bamboo set:
			Sou_1,
			Sou_2,
			Sou_3,
			Sou_4,
			Sou_5,
			Sou_6,
			Sou_7,
			Sou_8,
			Sou_9,
			// Winds:
			Ton,
			Nan,
			Xia,
			Pei,
			// Dragons:
			Chun,
			Haku,
			Hatsu
		};
		
		Type type;
		bool red;
		bool rotated;
		
		Tile();
		Tile(Type t, bool re = false, bool ro = false);
		
		virtual ~Tile(){};
		
		template<class Archive>
		void serialize(Archive & ar, const unsigned int version) {
			ar & type;
			ar & red;
			ar & rotated;
		}
};

typedef std::vector<Tile> Tiles;

#endif