-
Notifications
You must be signed in to change notification settings - Fork 40
/
annotation.hpp
119 lines (100 loc) · 4.14 KB
/
annotation.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#if !defined(KANACHAN_ANNOTATION_ANNOTATION_HPP_INCLUDE_GUARD)
#define KANACHAN_ANNOTATION_ANNOTATION_HPP_INCLUDE_GUARD
#include "annotation/round_progress.hpp"
#include "annotation/player_state.hpp"
#include "common/mahjongsoul.pb.h"
#include <iosfwd>
#include <limits>
#include <cstdint>
namespace Kanachan{
class Annotation
{
private:
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::uint_fast8_t prev_dapai_seat,
std::uint_fast8_t prev_dapai,
std::vector<lq::OptionalOperation> const &action_candidates);
public:
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::uint_fast8_t prev_dapai_seat,
std::uint_fast8_t prev_dapai,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::RecordDealTile const &);
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::RecordDiscardTile const &record);
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_state,
Kanachan::RoundProgress const &round_progress,
std::uint_fast8_t prev_dapai_seat,
std::uint_fast8_t prev_dapai,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::RecordChiPengGang const &record,
bool skipped);
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::RecordAnGangAddGang const &record);
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::uint_fast8_t prev_dapai_seat,
std::uint_fast8_t prev_dapai,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::HuleInfo const *p_record);
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::RecordLiuJu const &);
Annotation(
std::uint_fast8_t seat,
std::array<Kanachan::PlayerState, 4u> const &player_states,
Kanachan::RoundProgress const &round_progress,
std::uint_fast8_t prev_dapai_seat,
std::uint_fast8_t prev_dapai,
std::vector<lq::OptionalOperation> const &action_candidates,
lq::RecordNoTile const &);
Annotation(Annotation const &) = default;
Annotation &operator=(Annotation const &) = delete;
void printWithRoundResult(
std::string const &uuid, std::uint_fast8_t i,
Kanachan::RoundProgress const &round_progress,
std::uint_fast8_t round_result,
std::array<std::int_fast32_t, 4u> const &round_delta_scores,
std::array<std::uint_fast8_t, 4u> const &round_ranks,
std::ostream &os) const;
private:
static constexpr std::uint_fast16_t dapai_offset_ = 0u;
static constexpr std::uint_fast16_t angang_offset_ = 148u;
static constexpr std::uint_fast16_t jiagang_offset_ = 182u;
static constexpr std::uint_fast16_t zimohu_offset_ = 219u;
static constexpr std::uint_fast16_t liuju_offset_ = 220u;
static constexpr std::uint_fast16_t skip_offset_ = 221u;
static constexpr std::uint_fast16_t chi_offset_ = 222u;
static constexpr std::uint_fast16_t peng_offset_ = 312u;
static constexpr std::uint_fast16_t daminggang_offset_ = 432u;
static constexpr std::uint_fast16_t rong_offset_ = 543u;
std::uint_fast8_t seat_;
std::array<Kanachan::PlayerState, 4u> player_states_;
std::uint_fast8_t round_progress_size_;
// Action
std::vector<uint_fast16_t> action_candidates_;
std::uint_fast8_t action_index_ = std::numeric_limits<std::uint_fast8_t>::max();
}; // class Annotation
} // namespace Kanachan
#endif // !defined(KANACHAN_ANNOTATION_ANNOTATION_HPP_INCLUDE_GUARD)