aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/types/IdentifierRegistry.cpp
diff options
context:
space:
mode:
author Steve Frampton <40193522+FarmingtonS9@users.noreply.github.com>2023-09-16 01:15:33 +0200
committer GitHub <noreply@github.com>2023-09-16 01:15:33 +0200
commit879b9debfb97c48ed46d777b2a99d71757658cc6 (patch)
tree87974e84563d08c2f2762b75da0cfb2b4e28eab2 /src/openvic-simulation/types/IdentifierRegistry.cpp
parent6278a35f4704574933464700026d8deb997da5c1 (diff)
parent8cf93b6523dc380ef0c7215e15e327a78bf4578e (diff)
Merge pull request #15 from OpenVicProject/more-dataloading
More dataloading
Diffstat (limited to 'src/openvic-simulation/types/IdentifierRegistry.cpp')
-rw-r--r--src/openvic-simulation/types/IdentifierRegistry.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openvic-simulation/types/IdentifierRegistry.cpp b/src/openvic-simulation/types/IdentifierRegistry.cpp
index e33bc29..f284164 100644
--- a/src/openvic-simulation/types/IdentifierRegistry.cpp
+++ b/src/openvic-simulation/types/IdentifierRegistry.cpp
@@ -21,8 +21,8 @@ std::ostream& OpenVic::operator<<(std::ostream& stream, HasIdentifier const* obj
return obj != nullptr ? stream << *obj : stream << "<NULL>";
}
-HasColour::HasColour(colour_t const new_colour, bool can_be_null) : colour(new_colour) {
- assert((can_be_null || colour != NULL_COLOUR) && colour <= MAX_COLOUR_RGB);
+HasColour::HasColour(colour_t const new_colour, bool can_be_null, bool can_have_alpha) : colour(new_colour) {
+ assert((can_be_null || colour != NULL_COLOUR) && colour <= (!can_have_alpha ? MAX_COLOUR_RGB : MAX_COLOUR_ARGB));
}
colour_t HasColour::get_colour() const { return colour; }
@@ -32,9 +32,9 @@ std::string HasColour::colour_to_hex_string() const {
}
HasIdentifierAndColour::HasIdentifierAndColour(const std::string_view new_identifier,
- const colour_t new_colour, bool can_be_null)
+ const colour_t new_colour, bool can_be_null, bool can_have_alpha)
: HasIdentifier { new_identifier },
- HasColour { new_colour, can_be_null } {}
+ HasColour { new_colour, can_be_null, can_have_alpha } {}
distribution_t::value_type OpenVic::get_largest_item(distribution_t const& dist) {
const distribution_t::const_iterator result = std::max_element(dist.begin(), dist.end(),