diff options
author | Hop311 <Hop3114@gmail.com> | 2024-10-31 21:50:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 21:50:36 +0100 |
commit | b602c10cf890c5973c1efbe8d958bf9b67499efe (patch) | |
tree | 3b34e78831ab11d6333ce2822b10244995a69848 /src/openvic-simulation/dataloader/NodeTools.cpp | |
parent | 968c60580997d26035496cc675138e580354332f (diff) | |
parent | dbf58b1b1d318b4a82cf22b5b8e720c753388f4b (diff) |
Merge pull request #222 from OpenVicProject/defines-variables
Load defines directly into named and typed variables rather than using an IdentifierRegistry
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.cpp')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.cpp b/src/openvic-simulation/dataloader/NodeTools.cpp index ad130ad..b7b3e34 100644 --- a/src/openvic-simulation/dataloader/NodeTools.cpp +++ b/src/openvic-simulation/dataloader/NodeTools.cpp @@ -234,19 +234,19 @@ node_callback_t NodeTools::expect_date_identifier_or_string(callback_t<Date> cal } node_callback_t NodeTools::expect_years(callback_t<Timespan> callback) { - return expect_uint<Timespan::day_t>([callback](Timespan::day_t val) -> bool { + return expect_int<Timespan::day_t>([callback](Timespan::day_t val) -> bool { return callback(Timespan::from_years(val)); }); } node_callback_t NodeTools::expect_months(callback_t<Timespan> callback) { - return expect_uint<Timespan::day_t>([callback](Timespan::day_t val) -> bool { + return expect_int<Timespan::day_t>([callback](Timespan::day_t val) -> bool { return callback(Timespan::from_months(val)); }); } node_callback_t NodeTools::expect_days(callback_t<Timespan> callback) { - return expect_uint<Timespan::day_t>([callback](Timespan::day_t val) -> bool { + return expect_int<Timespan::day_t>([callback](Timespan::day_t val) -> bool { return callback(Timespan::from_days(val)); }); } |