From 172ad2fcc34b567eab9eca1f907cd99574fa031e Mon Sep 17 00:00:00 2001 From: hop311 Date: Thu, 29 Aug 2024 19:54:58 +0100 Subject: Remove unnecessary asserts + make `vec2_t(T val)` constructor explicit --- src/openvic-simulation/economy/GoodDefinition.cpp | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/openvic-simulation/economy') diff --git a/src/openvic-simulation/economy/GoodDefinition.cpp b/src/openvic-simulation/economy/GoodDefinition.cpp index 104764b..892592d 100644 --- a/src/openvic-simulation/economy/GoodDefinition.cpp +++ b/src/openvic-simulation/economy/GoodDefinition.cpp @@ -1,20 +1,28 @@ #include "GoodDefinition.hpp" -#include - using namespace OpenVic; using namespace OpenVic::NodeTools; GoodCategory::GoodCategory(std::string_view new_identifier) : HasIdentifier { new_identifier } {} GoodDefinition::GoodDefinition( - std::string_view new_identifier, colour_t new_colour, index_t new_index, GoodCategory const& new_category, - price_t new_base_price, bool new_available_from_start, bool new_tradeable, bool new_money, bool new_overseas_penalty -) : HasIdentifierAndColour { new_identifier, new_colour, false }, HasIndex { new_index }, category { new_category }, - base_price { new_base_price }, available_from_start { new_available_from_start }, tradeable { new_tradeable }, - money { new_money }, overseas_penalty { new_overseas_penalty } { - assert(base_price > NULL_PRICE); -} + std::string_view new_identifier, + colour_t new_colour, + index_t new_index, + GoodCategory const& new_category, + price_t new_base_price, + bool new_available_from_start, + bool new_tradeable, + bool new_money, + bool new_overseas_penalty +) : HasIdentifierAndColour { new_identifier, new_colour, false }, + HasIndex { new_index }, + category { new_category }, + base_price { new_base_price }, + available_from_start { new_available_from_start }, + tradeable { new_tradeable }, + money { new_money }, + overseas_penalty { new_overseas_penalty } {} bool GoodDefinitionManager::add_good_category(std::string_view identifier) { if (identifier.empty()) { -- cgit v1.2.3-56-ga3b1