From 89c93f98b865c20cd3c3486a9b91323565e759fc Mon Sep 17 00:00:00 2001 From: hop311 Date: Tue, 12 Dec 2023 00:34:53 +0000 Subject: Province pop history + country government flag override refactors --- src/openvic-simulation/types/fixed_point/FixedPoint.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/openvic-simulation/types') diff --git a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp index ba6790f..75abefb 100644 --- a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp +++ b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp @@ -214,6 +214,10 @@ namespace OpenVic { return value & (ONE - 1); } + constexpr bool is_integer() const { + return get_frac() == 0; + } + constexpr int64_t to_int64_t() const { return value >> PRECISION; } -- cgit v1.2.3-56-ga3b1