/nix/store/i1aar97n7b4yf8rk94p66if25brfvvdx-gqvzl8a5pvrg3xj44q0msrndcripi8dk-source/src/controllers/alphabeticalbot.h
Line | Count | Source |
1 | | #pragma once |
2 | | #include <memory> |
3 | | #include <string> |
4 | | #include <vector> |
5 | | |
6 | | #include "controllers/playercontroller.h" |
7 | | #include "types/event.h" |
8 | | #include "types/piecetype.h" |
9 | | #include "types/winds.h" |
10 | | |
11 | | namespace mahjong { |
12 | | |
13 | | // Always Discards Alphabetically. |
14 | | class AlphabeticalBot : public PlayerController { |
15 | | public: |
16 | 0 | static std::unique_ptr<PlayerController> New() { |
17 | 0 | return std::make_unique<AlphabeticalBot>(); |
18 | 0 | } |
19 | | |
20 | 0 | void GameStart(int player_id) override { id_ = player_id; } |
21 | | void RoundStart(std::vector<Piece> hand, Wind seatWind, |
22 | | Wind prevalentWind) override; |
23 | | void ReceiveEvent(Event e) override; |
24 | | Event RetrieveDecision() override; |
25 | | |
26 | 0 | std::string Name() override { return "AlphabeticalBot"; }; |
27 | | |
28 | | private: |
29 | | int getDiscardPiece(); |
30 | | |
31 | | std::vector<Piece> hand_; |
32 | | int id_; |
33 | | Event decisionToTake_; |
34 | | }; |
35 | | } // namespace mahjong |