aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-08-29 20:54:58 +0200
committer hop311 <hop3114@gmail.com>2024-08-29 20:54:58 +0200
commit172ad2fcc34b567eab9eca1f907cd99574fa031e (patch)
treebedfa97590a31eb5f2871b7921e48423d1ddabde /src/openvic-simulation/map
parent5813948cd3ed6432de374664650d68afbff71915 (diff)
Remove unnecessary asserts + make `vec2_t(T val)` constructor explicitremove-asserts
Diffstat (limited to 'src/openvic-simulation/map')
-rw-r--r--src/openvic-simulation/map/Mapmode.cpp12
-rw-r--r--src/openvic-simulation/map/ProvinceDefinition.cpp24
2 files changed, 23 insertions, 13 deletions
diff --git a/src/openvic-simulation/map/Mapmode.cpp b/src/openvic-simulation/map/Mapmode.cpp
index cab67d1..f951a05 100644
--- a/src/openvic-simulation/map/Mapmode.cpp
+++ b/src/openvic-simulation/map/Mapmode.cpp
@@ -1,7 +1,5 @@
#include "Mapmode.hpp"
-#include <cassert>
-
#include "openvic-simulation/country/CountryInstance.hpp"
#include "openvic-simulation/map/MapDefinition.hpp"
#include "openvic-simulation/map/MapInstance.hpp"
@@ -13,10 +11,12 @@ using namespace OpenVic;
using namespace OpenVic::colour_literals;
Mapmode::Mapmode(
- std::string_view new_identifier, index_t new_index, colour_func_t new_colour_func
-) : HasIdentifier { new_identifier }, HasIndex { new_index }, colour_func { new_colour_func } {
- assert(colour_func != nullptr);
-}
+ std::string_view new_identifier,
+ index_t new_index,
+ colour_func_t new_colour_func
+) : HasIdentifier { new_identifier },
+ HasIndex { new_index },
+ colour_func { new_colour_func } {}
const Mapmode Mapmode::ERROR_MAPMODE {
"mapmode_error", 0, [](MapInstance const&, ProvinceInstance const& province) -> base_stripe_t {
diff --git a/src/openvic-simulation/map/ProvinceDefinition.cpp b/src/openvic-simulation/map/ProvinceDefinition.cpp
index 4f34c1e..14828e8 100644
--- a/src/openvic-simulation/map/ProvinceDefinition.cpp
+++ b/src/openvic-simulation/map/ProvinceDefinition.cpp
@@ -8,13 +8,23 @@ using namespace OpenVic;
using namespace OpenVic::NodeTools;
ProvinceDefinition::ProvinceDefinition(
- std::string_view new_identifier, colour_t new_colour, index_t new_index
-) : HasIdentifierAndColour { new_identifier, new_colour, true }, HasIndex { new_index }, region { nullptr },
- climate { nullptr }, continent { nullptr }, on_map { false }, water { false }, coastal { false },
- port { false }, port_adjacent_province { nullptr }, default_terrain_type { nullptr }, adjacencies {}, centre {},
- positions {} {
- assert(index != NULL_INDEX);
-}
+ std::string_view new_identifier,
+ colour_t new_colour,
+ index_t new_index
+) : HasIdentifierAndColour { new_identifier, new_colour, true },
+ HasIndex { new_index },
+ region { nullptr },
+ climate { nullptr },
+ continent { nullptr },
+ on_map { false },
+ water { false },
+ coastal { false },
+ port { false },
+ port_adjacent_province { nullptr },
+ default_terrain_type { nullptr },
+ adjacencies {},
+ centre {},
+ positions {} {}
bool ProvinceDefinition::operator==(ProvinceDefinition const& other) const {
return this == &other;