DigitalCurling3  1.0.0
A curling simulation system for curling AIs
apply_move.hpp
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2022 UEC Takeshi Ito Laboratory
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in all
13 // copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 // SOFTWARE.
22 
25 
26 #ifndef DIGITALCURLING3_APPLY_MOVE_HPP
27 #define DIGITALCURLING3_APPLY_MOVE_HPP
28 
29 #include <functional>
30 #include <chrono>
31 #include "json/common.hpp"
32 #include "game_setting.hpp"
33 #include "i_simulator.hpp"
34 #include "i_player.hpp"
35 #include "game_state.hpp"
36 #include "move.hpp"
37 
38 
39 namespace digitalcurling3 {
40 
41 
45 };
46 
47 
68 void ApplyMove(
69  GameSetting const& setting,
70  ISimulator & simulator,
71  IPlayer & player,
72  GameState & state,
73  Move & move,
74  std::chrono::milliseconds const& thinking_time_used,
75  ApplyMoveResult * result = nullptr,
76  std::function<void(ISimulator const &)> on_step = nullptr);
77 
78 
79 
80 
82 // json
83 NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(
85  free_guard_zone_foul
86 )
88 
89 } // namespace digitalcurling3
90 
91 
92 #endif // DIGITALCURLING3_APPLY_MOVE_HPP
digitalcurling3::ApplyMoveResult
ApplyMove() の返り値
Definition: apply_move.hpp:43
digitalcurling3::GameSetting
試合設定
Definition: game_setting.hpp:37
digitalcurling3::GameState
試合の状態を表す
Definition: game_state.hpp:53
digitalcurling3::IPlayer
理想的なショットを与えられた際に,乱数を加えたりしてプレイヤーによるブレを付与する
Definition: i_player.hpp:45
common.hpp
必要なJSON変換関数を定義します
digitalcurling3::ApplyMoveResult::free_guard_zone_foul
bool free_guard_zone_foul
フリーガードゾーンルールに違反した場合 true
Definition: apply_move.hpp:44
digitalcurling3::Move
std::variant< moves::Shot, moves::Concede > Move
ターンごとにチームが採る行動
Definition: move.hpp:40
digitalcurling3::ISimulator
ストーンの挙動を再現する物理シミュレータを扱うためのインターフェイス
Definition: i_simulator.hpp:57
digitalcurling3
Digital Curling ライブラリはこの名前空間の中に定義されます
Definition: polymorphic_json.hpp:37
game_state.hpp
GameState を定義します
i_simulator.hpp
ISimulator を定義します
game_setting.hpp
GameSetting を定義します
digitalcurling3::ApplyMove
void ApplyMove(GameSetting const &setting, ISimulator &simulator, IPlayer &player, GameState &state, Move &move, std::chrono::milliseconds const &thinking_time_used, ApplyMoveResult *result=nullptr, std::function< void(ISimulator const &)> on_step=nullptr)
試合を1ターン進めます
move.hpp
Move を定義します
i_player.hpp
IShotRandomizer を定義します