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
namespace
designlab
{
11
12
std::tuple<bool, std::string>
SimulationMapParameterValidator::Validate
(
13
const
SimulationMapParameter
& toml_data)
const
{
14
if
(toml_data.
hole_rate
< 0 || 100 < toml_data.
hole_rate
) {
15
return
{
false
, kErrMesPerforatedRange};
16
}
17
18
if
(toml_data.
rough_min_height
> toml_data.
rough_max_height
) {
19
return
{
false
, kErrMesRoughnessMaxMin};
20
}
21
22
if
(toml_data.
stripe_interval
< 0) {
23
return
{
false
, kErrMesStripeGtZero};
24
}
25
26
if
(toml_data.
step_length
< 0) {
27
return
{
false
, kErrMesStepLengthGtZero};
28
}
29
30
return
{
true
,
""
};
31
}
32
33
}
// namespace designlab
designlab::SimulationMapParameterValidator::Validate
std::tuple< bool, std::string > Validate(const SimulationMapParameter &toml_data) const override
TOMLファイルのデータの検証を行う.
Definition
simulation_map_parameter_validator.cpp:12
designlab
Definition
abstract_dxlib_gui.cpp:18
simulation_map_parameter_validator.h
designlab::SimulationMapParameter
マップ生成時のモードとオプションを指定する構造体.
Definition
simulation_map_parameter.h:52
designlab::SimulationMapParameter::stripe_interval
int stripe_interval
各種模様や穴を作成する際,これで指定したマス分の1辺を持つ正方形状にあなをあける.
Definition
simulation_map_parameter.h:145
designlab::SimulationMapParameter::step_length
float step_length
階段の奥行[mm]
Definition
simulation_map_parameter.h:149
designlab::SimulationMapParameter::rough_min_height
float rough_min_height
デコボコな地形の最小高さ[mm]
Definition
simulation_map_parameter.h:153
designlab::SimulationMapParameter::rough_max_height
float rough_max_height
デコボコな地形の最大高さ[mm]
Definition
simulation_map_parameter.h:152
designlab::SimulationMapParameter::hole_rate
int hole_rate
不整地上の足場を除外する割合。ホール率[%]
Definition
simulation_map_parameter.h:147
構築:
1.9.8