DigitalCurling3  1.0.0
A curling simulation system for curling AIs
simulator_fcv1_factory.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_SIMULATORS_SIMULATOR_FCV1_FACTORY_HPP
27 #define DIGITALCURLING3_SIMULATORS_SIMULATOR_FCV1_FACTORY_HPP
28 
29 #include <string_view>
30 #include "../json/common.hpp"
31 #include "../i_simulator_factory.hpp"
32 
34 
36 constexpr std::string_view kSimulatorFCV1Id = "fcv1";
37 
42 public:
49  float seconds_per_frame = 0.001f;
50 
51  SimulatorFCV1Factory() = default;
52  SimulatorFCV1Factory(SimulatorFCV1Factory const&) = default;
54  virtual ~SimulatorFCV1Factory() = default;
55 
56  virtual std::unique_ptr<ISimulator> CreateSimulator() const override;
57  virtual std::unique_ptr<ISimulatorFactory> Clone() const override;
58  virtual std::string GetSimulatorId() const override
59  {
60  return std::string(kSimulatorFCV1Id);
61  }
62 };
63 
64 
66 // json
67 void to_json(nlohmann::json &, SimulatorFCV1Factory const&);
68 void from_json(nlohmann::json const&, SimulatorFCV1Factory &);
70 
71 } // namespace digitalcurling3::simulators
72 
73 #endif // DIGITALCURLING3_SIMULATORS_SIMULATOR_FCV1_FACTORY_HPP
digitalcurling3::simulators::SimulatorFCV1Factory::CreateSimulator
virtual std::unique_ptr< ISimulator > CreateSimulator() const override
シミュレータを生成する
digitalcurling3::simulators::kSimulatorFCV1Id
constexpr std::string_view kSimulatorFCV1Id
シミュレータFCV1のID
Definition: simulator_fcv1_factory.hpp:36
digitalcurling3::simulators::SimulatorFCV1Factory
シミュレータFCV1(Friction-CurlVelocity 1)を構築するためのクラスです
Definition: simulator_fcv1_factory.hpp:41
digitalcurling3::simulators::SimulatorFCV1Factory::seconds_per_frame
float seconds_per_frame
フレームレート(フレーム毎秒)
Definition: simulator_fcv1_factory.hpp:49
digitalcurling3::simulators
ISimulatorFactory を継承したクラスを定義する名前空間
Definition: simulator_fcv1_factory.hpp:33
digitalcurling3::simulators::SimulatorFCV1Factory::operator=
SimulatorFCV1Factory & operator=(SimulatorFCV1Factory const &)=default
コピー代入演算子
digitalcurling3::ISimulatorFactory
ISimulator を構築するためのクラスです
Definition: i_simulator_factory.hpp:42
digitalcurling3::simulators::SimulatorFCV1Factory::Clone
virtual std::unique_ptr< ISimulatorFactory > Clone() const override
このインスタンスを複製する
digitalcurling3::simulators::SimulatorFCV1Factory::GetSimulatorId
virtual std::string GetSimulatorId() const override
対応するシミュレータのシミュレータIDを得る.
Definition: simulator_fcv1_factory.hpp:58