Modified Flat detection options

develop
PatrikLundell 2019-06-23 18:35:28 +02:00
parent b5e38451de
commit 3e97643b37
1 changed files with 39 additions and 8 deletions

@ -40,7 +40,7 @@ namespace embark_assist {
min_river, min_river,
max_river, max_river,
waterfall, waterfall,
flat, flatness,
clay, clay,
sand, sand,
flux, flux,
@ -246,7 +246,7 @@ namespace embark_assist {
fclose(infile); fclose(infile);
// Checking done. No do the work. // Checking done. Now do the work.
infile = fopen(profile_file_name, "r"); infile = fopen(profile_file_name, "r");
i = first_fields; i = first_fields;
@ -453,7 +453,6 @@ namespace embark_assist {
break; break;
case fields::waterfall: case fields::waterfall:
case fields::flat:
case fields::blood_rain: case fields::blood_rain:
{ {
embark_assist::defs::yes_no_ranges k = embark_assist::defs::yes_no_ranges::NA; embark_assist::defs::yes_no_ranges k = embark_assist::defs::yes_no_ranges::NA;
@ -482,6 +481,38 @@ namespace embark_assist {
break; break;
case fields::flatness:
{
embark_assist::defs::flatness_ranges k = embark_assist::defs::flatness_ranges::NA;
while (true) {
switch (k) {
case embark_assist::defs::flatness_ranges::NA:
element->list.push_back({ "N/A", static_cast<int8_t>(k) });
break;
case embark_assist::defs::flatness_ranges::Flat_Verified:
element->list.push_back({ "Flat Verified", static_cast<int8_t>(k) });
break;
case embark_assist::defs::flatness_ranges::Mostly_Flat:
element->list.push_back({ "Mostly Flat", static_cast<int8_t>(k) });
break;
case embark_assist::defs::flatness_ranges::Uneven:
element->list.push_back({ "Uneven", static_cast<int8_t>(k) });
break;
}
if (k == embark_assist::defs::flatness_ranges::Uneven) {
break;
}
k = static_cast <embark_assist::defs::flatness_ranges>(static_cast<int8_t>(k) + 1);
}
}
break;
case fields::soil_min_everywhere: case fields::soil_min_everywhere:
{ {
embark_assist::defs::all_present_ranges k = embark_assist::defs::all_present_ranges::All; embark_assist::defs::all_present_ranges k = embark_assist::defs::all_present_ranges::All;
@ -959,8 +990,8 @@ namespace embark_assist {
state->finder_list.push_back({ "Waterfall", static_cast<int8_t>(i) }); state->finder_list.push_back({ "Waterfall", static_cast<int8_t>(i) });
break; break;
case fields::flat: case fields::flatness:
state->finder_list.push_back({ "Flat", static_cast<int8_t>(i) }); state->finder_list.push_back({ "Flatness", static_cast<int8_t>(i) });
break; break;
case fields::soil_min_everywhere: case fields::soil_min_everywhere:
@ -1189,9 +1220,9 @@ namespace embark_assist {
static_cast<embark_assist::defs::yes_no_ranges>(state->ui[static_cast<uint8_t>(i)]->current_value); static_cast<embark_assist::defs::yes_no_ranges>(state->ui[static_cast<uint8_t>(i)]->current_value);
break; break;
case fields::flat: case fields::flatness:
finder.flat = finder.flatness =
static_cast<embark_assist::defs::yes_no_ranges>(state->ui[static_cast<uint8_t>(i)]->current_value); static_cast<embark_assist::defs::flatness_ranges>(state->ui[static_cast<uint8_t>(i)]->current_value);
break; break;
case fields::soil_min_everywhere: case fields::soil_min_everywhere: