-
Notifications
You must be signed in to change notification settings - Fork 40
/
round_progress.hpp
51 lines (34 loc) · 1.52 KB
/
round_progress.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
#if !defined(KANACHAN_ANNOTATION_ROUND_PROGRESS_HPP_INCLUDE_GUARD)
#define KANACHAN_ANNOTATION_ROUND_PROGRESS_HPP_INCLUDE_GUARD
#include "common/mahjongsoul.pb.h"
#include <iosfwd>
#include <vector>
#include <cstdint>
#include <cstddef>
namespace Kanachan{
class RoundProgress
{
public:
RoundProgress() = default;
RoundProgress(RoundProgress const &) = delete;
RoundProgress &operator=(RoundProgress const &) = delete;
void onNewRound(lq::RecordNewRound const &);
void onZimo(lq::RecordDealTile const &record);
void onDapai(lq::RecordDiscardTile const &record);
void onChiPengGang(lq::RecordChiPengGang const &record);
void onGang(lq::RecordAnGangAddGang const &record);
std::size_t getSize() const;
void print(std::size_t size, std::ostream &os) const;
private:
static constexpr std::uint_fast16_t beginning_of_round_offset_ = 0u;
static constexpr std::uint_fast16_t zimo_offset_ = 1u;
static constexpr std::uint_fast16_t dapai_offset_ = 5u;
static constexpr std::uint_fast16_t chi_offset_ = 597u;
static constexpr std::uint_fast16_t peng_offset_ = 957u;
static constexpr std::uint_fast16_t daminggang_offset_ = 1437u;
static constexpr std::uint_fast16_t angang_offset_ = 1881u;
static constexpr std::uint_fast16_t jiagang_offset_ = 2017u;
std::vector<std::uint_fast16_t> events_;
}; // class RoundProgress
} // namespace Kanachan
#endif // !defined(KANACHAN_ANNOTATION_ROUND_PROGRESS_HPP_INCLUDE_GUARD)