summaryrefslogtreecommitdiff
path: root/common/action.h
blob: 1c07086309df9c3794a215f3a2439d1461dd08b8 (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
#ifndef ACTION_H
#define ACTION_H

#include <vector>

class Action {
	public:
		//! Action types.
		enum Type {
			Pass,    // discard
			Discard, // draw
			Riichi,  // draw
			Chi,     // discard
			Pon,     // discard
			Kan,     // draw, discard
			Ron,     // discard
			Tsumo,   // draw
			Draw     // draw
		};
		
		//! Type of action.
		Type type;
		
		//! Target of action (if applicable).
		int target;
		
		//! Player doing this action
		int player;
		
		template<class Archive>
		void serialize(Archive & ar, const unsigned int version) {
			ar & type;
			ar & target;
			ar & player;
		}
};

typedef std::vector<Action> Actions;

#endif