-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathgame.hpp
81 lines (67 loc) · 1.81 KB
/
game.hpp
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
77
78
79
80
81
//
// game.hpp
// DouDiZhu
//
// Created by Neil on 07/07/2017.
// Copyright © 2017 Neil. All rights reserved.
//
#ifndef game_hpp
#define game_hpp
#include <stdio.h>
#include <vector>
#include "card.hpp"
#include <random>
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
namespace py = pybind11;
//AI
struct ALLCardsList
{
std::vector<int> arrCardsList[3];
};
class GameSituation
{
public:
GameSituation()
{
}
~GameSituation()
{
for (int i = 0; i < 3; i++) color_aUnitOutCardList[i].clear();
}
public:
//
int nDiZhuID = -1;
//
int nLandScore = 0;
//
int nNowDiZhuID = -1;
//
int nNowLandScore = 0;
//
int DiPai[3] = { 0 };
//index0~4
int value_aAllOutCardList[18] = { 0 };
//
int value_aUnitOutCardList[3][18] = { {0} };
//
int value_aUnitHandCardCount[3] = { 0 };
//
int nMultiple = 1;
//
int nCardDroit = 0;
//
CardGroupData uctNowCardGroup;
//
bool Over = false;
std::vector<int> color_aUnitOutCardList[3];
};
int LandScore(GameSituation &clsGameSituation, HandCardData &clsHandCardData, int &);
void InitCards(vector <int> &Cards, std::mt19937& g);
void InitCards2(const py::array_t<int>& pycards, vector <int> &Cards);
void InitCards_Appoint(vector <int> &Cards);
void SendCards(GameSituation & clsGameSituation, ALLCardsList &uctALLCardsList, std::mt19937& g);
void SendCards_manual(const py::array_t<int>& pycards, GameSituation & clsGameSituation, ALLCardsList &uctALLCardsList, std::mt19937& g);
void SendCards2(const py::array_t<int>& init_cards, GameSituation & clsGameSituation, ALLCardsList &uctALLCardsList);
void SendCards2_manual(const py::array_t<int>& pycards, GameSituation & clsGameSituation, ALLCardsList &uctALLCardsList);
#endif /* game_hpp */