summaryrefslogtreecommitdiff
path: root/common/tile.cpp
blob: 15d0d9d141bf78ab97944a51f5cf439bc535938c (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
#include "tile.h"

Tile::Tile() {
	
}

Tile::Tile(Tile::Type t, bool re, bool ro) : type(t), red(re), rotated(ro){
	
}

int Tile::get_num() {
	if(type >= Man_1 && type <= Sou_9) {
		return (type - Man_1) % 9 + 1;
	} else {
		return 0;
	}
}

bool Tile::operator==(const Tile& other) {
	return type == other.type;
}

Tile Tile::operator++(int) {
	type = Type(type + 1);
	return *this;
}