aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/types
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-16 17:27:41 +0200
committer Hop311 <hop3114@gmail.com>2023-09-16 17:28:01 +0200
commitf95902fdd85f86c10b9c300099c67312fc81f11b (patch)
tree1655119602f39a366de8248cb4651321b6dfdda0 /src/openvic-simulation/types
parent64d134ad20c333afa60373526d6fab27a07c6adc (diff)
Scaffolding for `positions.txt` + modifier loading
Diffstat (limited to 'src/openvic-simulation/types')
-rw-r--r--src/openvic-simulation/types/IdentifierRegistry.hpp6
-rw-r--r--src/openvic-simulation/types/Vector.hpp1
2 files changed, 4 insertions, 3 deletions
diff --git a/src/openvic-simulation/types/IdentifierRegistry.hpp b/src/openvic-simulation/types/IdentifierRegistry.hpp
index 3f73a2c..8dabd46 100644
--- a/src/openvic-simulation/types/IdentifierRegistry.hpp
+++ b/src/openvic-simulation/types/IdentifierRegistry.hpp
@@ -171,7 +171,7 @@ namespace OpenVic {
return items;
}
- NodeTools::node_callback_t expect_item(T const*& ret) const {
+ NodeTools::node_callback_t expect_item_identifier(T const*& ret) const {
return NodeTools::expect_identifier(
[this, &ret](std::string_view identifier) -> bool {
ret = get_item_by_identifier(identifier);
@@ -193,8 +193,8 @@ namespace OpenVic {
return plural.size(); } \
std::vector<type> const& get_##plural() const { \
return plural.get_items(); } \
- NodeTools::node_callback_t expect_##singular(type const*& ret) const { \
- return plural.expect_item(ret); }
+ NodeTools::node_callback_t expect_##singular##_identifier(type const*& ret) const { \
+ return plural.expect_item_identifier(ret); }
#define IDENTIFIER_REGISTRY_ACCESSORS(type, name) IDENTIFIER_REGISTRY_ACCESSORS_CUSTOM_PLURAL(type, name, name##s)
}
diff --git a/src/openvic-simulation/types/Vector.hpp b/src/openvic-simulation/types/Vector.hpp
index fdf7d70..66f8d2b 100644
--- a/src/openvic-simulation/types/Vector.hpp
+++ b/src/openvic-simulation/types/Vector.hpp
@@ -27,6 +27,7 @@ namespace OpenVic {
constexpr friend vec2_t operator-(vec2_t const& arg);
constexpr friend vec2_t operator-(vec2_t const& left, vec2_t const& right);
constexpr vec2_t& operator-=(vec2_t const& right);
+
constexpr friend std::ostream& operator<<(std::ostream& stream, vec2_t const& value);
};