aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/types/IdentifierRegistry.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-11-07 22:38:07 +0100
committer GitHub <noreply@github.com>2023-11-07 22:38:07 +0100
commitae2742113ec7283a2a5afa62f8bfd98a865c4208 (patch)
tree601591215af0c6724766019ebb577141ea5807c5 /src/openvic-simulation/types/IdentifierRegistry.cpp
parent1603fbafb1c03830f38fefd87d8bd0d7d3f135a2 (diff)
parentd30421fa7d7f6ad87d3f90cc0ab491742f0d2548 (diff)
Merge pull request #64 from OpenVicProject/modifier-instance
ModifierEffects stored as instances
Diffstat (limited to 'src/openvic-simulation/types/IdentifierRegistry.cpp')
-rw-r--r--src/openvic-simulation/types/IdentifierRegistry.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/openvic-simulation/types/IdentifierRegistry.cpp b/src/openvic-simulation/types/IdentifierRegistry.cpp
index faddd75..3964b12 100644
--- a/src/openvic-simulation/types/IdentifierRegistry.cpp
+++ b/src/openvic-simulation/types/IdentifierRegistry.cpp
@@ -8,10 +8,6 @@ HasIdentifier::HasIdentifier(std::string_view new_identifier) : identifier { new
assert(!identifier.empty());
}
-std::string_view HasIdentifier::get_identifier() const {
- return identifier;
-}
-
std::ostream& OpenVic::operator<<(std::ostream& stream, HasIdentifier const& obj) {
return stream << obj.get_identifier();
}
@@ -20,12 +16,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, 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;
+HasColour::HasColour(colour_t new_colour, bool cannot_be_null, bool can_have_alpha) : colour(new_colour) {
+ assert((!cannot_be_null || colour != NULL_COLOUR) && colour <= (!can_have_alpha ? MAX_COLOUR_RGB : MAX_COLOUR_ARGB));
}
std::string HasColour::colour_to_hex_string() const {
@@ -33,5 +25,5 @@ std::string HasColour::colour_to_hex_string() const {
}
HasIdentifierAndColour::HasIdentifierAndColour(
- std::string_view new_identifier, const colour_t new_colour, bool can_be_null, bool can_have_alpha
-) : HasIdentifier { new_identifier }, HasColour { new_colour, can_be_null, can_have_alpha } {}
+ std::string_view new_identifier, colour_t new_colour, bool cannot_be_null, bool can_have_alpha
+) : HasIdentifier { new_identifier }, HasColour { new_colour, cannot_be_null, can_have_alpha } {}