/nix/store/i1aar97n7b4yf8rk94p66if25brfvvdx-gqvzl8a5pvrg3xj44q0msrndcripi8dk-source/src/statefunctions/gamestates/gameend.cc
Line | Count | Source |
1 | | #include <memory> |
2 | | |
3 | | #include "controllers/playercontroller.h" |
4 | | #include "statefunctions/router.h" |
5 | | #include "types/event.h" |
6 | | #include "types/gamestate.h" |
7 | | #include "types/player.h" |
8 | | #include "types/statefunction.h" |
9 | | |
10 | | namespace mahjong { |
11 | | |
12 | | namespace { |
13 | 0 | std::unique_ptr<GameState> GameEnd(std::unique_ptr<GameState> state) { |
14 | 0 | for (auto& player : state->players) { |
15 | 0 | player.controller->ReceiveEvent(kEndEvent); |
16 | 0 | player.controller.reset(); |
17 | 0 | } |
18 | 0 | return state; |
19 | 0 | } |
20 | | } // namespace |
21 | | |
22 | | REGISTER_ROUTE(GameEnd, StateFunctionType::kGameEnd); |
23 | | } // namespace mahjong |