/nix/store/rr0r40cw3mzzbz0sxrnkvnrjpzb82wpc-j27cjzgh5nmq3y8k6hwa6zpi3qgcjia8-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/statefunction.h" |
8 | | |
9 | | namespace mahjong { |
10 | | |
11 | | namespace { |
12 | 0 | std::unique_ptr<GameState> GameEnd(std::unique_ptr<GameState> state) { |
13 | 0 | for (auto& controller : state->controllers) { |
14 | 0 | controller->ReceiveEvent(kEndEvent); |
15 | 0 | controller.reset(); |
16 | 0 | } |
17 | 0 | return state; |
18 | 0 | } |
19 | | } // namespace |
20 | | |
21 | | REGISTER_ROUTE(GameEnd, StateFunctionType::kGameEnd); |
22 | | } // namespace mahjong |