GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
DesignLab
simulation_map_parameter_validator.cpp
[詳解]
1
3
4
// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5
// Released under the MIT license
6
// https://opensource.org/licenses/mit-license.php
7
8
#include "
simulation_map_parameter_validator.h
"
9
10
11
namespace
designlab
12
{
13
14
std::tuple<bool, std::string>
SimulationMapParameterValidator::Validate
(
15
const
SimulationMapParameter
& toml_data)
const
16
{
17
if
(toml_data.
hole_rate
< 0 || 100 < toml_data.
hole_rate
)
18
{
19
return
{
false
, kErrMesPerforatedRange };
20
}
21
22
if
(toml_data.
rough_min_height
> toml_data.
rough_max_height
)
23
{
24
return
{
false
, kErrMesRoughnessMaxMin };
25
}
26
27
if
(toml_data.
stripe_interval
< 0)
28
{
29
return
{
false
, kErrMesStripeGtZero };
30
}
31
32
if
(toml_data.
step_length
< 0)
33
{
34
return
{
false
, kErrMesStepLengthGtZero };
35
}
36
37
return
{
true
,
""
};
38
}
39
40
}
// namespace designlab
designlab::SimulationMapParameterValidator::Validate
std::tuple< bool, std::string > Validate(const SimulationMapParameter &toml_data) const override
TOMLファイルのデータの検証を行う.
Definition
simulation_map_parameter_validator.cpp:14
designlab
Definition
abstract_dxlib_gui.cpp:18
simulation_map_parameter_validator.h
designlab::SimulationMapParameter
マップ生成時のモードとオプションを指定する構造体.
Definition
simulation_map_parameter.h:63
designlab::SimulationMapParameter::stripe_interval
int stripe_interval
各種模様や穴を作成する際,これで指定したマス分の1辺を持つ正方形状にあなをあける.
Definition
simulation_map_parameter.h:168
designlab::SimulationMapParameter::step_length
float step_length
階段の奥行[mm]
Definition
simulation_map_parameter.h:172
designlab::SimulationMapParameter::rough_min_height
float rough_min_height
デコボコな地形の最小高さ[mm]
Definition
simulation_map_parameter.h:176
designlab::SimulationMapParameter::rough_max_height
float rough_max_height
デコボコな地形の最大高さ[mm]
Definition
simulation_map_parameter.h:175
designlab::SimulationMapParameter::hole_rate
int hole_rate
不整地上の足場を除外する割合。ホール率[%]
Definition
simulation_map_parameter.h:170
構築:
1.9.8