-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmjcard.h
More file actions
76 lines (68 loc) · 1.32 KB
/
Copy pathmjcard.h
File metadata and controls
76 lines (68 loc) · 1.32 KB
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
73
74
75
76
/*
* @file mjcard.h
* @author YangSongxi
* @mail ysx-cpp@gmail.com
* @github https://github.com/ysx-cpp
* @date Oct 08 2020
*/
#ifndef MAJONG_MJ_CARD_H
#define MAJONG_MJ_CARD_H
#include <vector>
#include "icard.h"
#include "majong.pb.h"
namespace algorithm {
class MjCard : public ICard
{
public:
enum EFace
{
E_INVALID_FACE,
E_FACE_ONE,
E_FACE_TWO,
E_FACE_THREE,
E_FACE_FOUR,
E_FACE_FIVE,
E_FACE_SIX,
E_FACE_SEVEN,
E_FACE_EIGHT,
E_FACE_NINE,
E_FACE_COUNT_
};
enum EType
{
E_MYRIAD_TYPE, //万
// E_CYLINDER_TYPE, //筒
// E_SLIVER_TYPE, //条
E_WIND_TYPE, //风
E_WORD_TYPE, //字
E_FLOWER_TYPE, //花
E_TYPE_COUNT_
};
public:
MjCard(EType type, EFace face, int index)
: type_(type),
face_(face),
index_(index)
{
}
~MjCard() override {}
int index() const override;
int type() const override;
int face() const override;
int color() const override;
bool empty() const override;
std::string name() const override;
private:
EType type_;
EFace face_;
int index_;
};
using MjCardPtr = std::shared_ptr<MjCard>;
struct OutDoorCards
{
XGameMJProto::DoorCardType card_type = XGameMJProto::INVALID;
std::vector<ICardPtr> cards;
ICardPtr play_card;
};
} // namespace by
#endif // MAJONG_MJ_CARD_H