From 5194a3d043db66b81470111a94f3b1cdf8d42176 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 19 Oct 2024 11:43:15 +0100 Subject: Add modifier effect variants based on the type of modifier being parsed --- src/openvic-simulation/utility/NumberUtils.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/openvic-simulation/utility/NumberUtils.hpp') diff --git a/src/openvic-simulation/utility/NumberUtils.hpp b/src/openvic-simulation/utility/NumberUtils.hpp index d814019..8656f27 100644 --- a/src/openvic-simulation/utility/NumberUtils.hpp +++ b/src/openvic-simulation/utility/NumberUtils.hpp @@ -49,4 +49,8 @@ namespace OpenVic::NumberUtils { return c; } + + constexpr bool is_power_of_two(uint64_t n) { + return n > 0 && (n & (n - 1)) == 0; + } } -- cgit v1.2.3-56-ga3b1