From 7b7effff1204424694f801d620252b5b3f102a13 Mon Sep 17 00:00:00 2001 From: "Z.A" Date: Mon, 15 Feb 2021 15:06:13 -0800 Subject: [PATCH] compulsive consistency tweaks --- src/adera/ShipResources.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/adera/ShipResources.h b/src/adera/ShipResources.h index dade048f..423a2af7 100644 --- a/src/adera/ShipResources.h +++ b/src/adera/ShipResources.h @@ -90,10 +90,10 @@ struct ShipResourceType const uint64_t m_quantaPerUnit; // The volume (in m^3) of one unit of this resource - const float m_volume; + const float m_volumePerUnit; - // The mass (in kg) of 1 unit of this resource - const float m_mass; + // The mass (in kg) of one unit of this resource + const float m_massPerUnit; // The density of this resource (kg/m^3) const float m_density; @@ -102,27 +102,27 @@ struct ShipResourceType constexpr double resource_volume(uint64_t quantity) const { double units = static_cast(quantity) / m_quantaPerUnit; - return units * m_volume; + return units * m_volumePerUnit; } // Compute the mass of the specified quantity of resource constexpr double resource_mass(uint64_t quantity) const { double units = static_cast(quantity) / m_quantaPerUnit; - return units * m_mass; + return units * m_massPerUnit; } // Compute the quantity of resource that fits in the specified volume constexpr uint64_t resource_capacity(double volume) const { - double units = volume / m_volume; + double units = volume / m_volumePerUnit; return static_cast(units * m_quantaPerUnit); } // Compute the quantity of resource that masses the specified amount constexpr uint64_t resource_quantity(double mass) const { - double units = mass / m_mass; + double units = mass / m_massPerUnit; return static_cast(units * m_quantaPerUnit); } @@ -131,8 +131,8 @@ struct ShipResourceType : m_identifier(std::move(identifier)) , m_displayName(std::move(displayName)) , m_quantaPerUnit(quantaPerUnit) - , m_volume(volume) - , m_mass(mass) + , m_volumePerUnit(volume) + , m_massPerUnit(mass) , m_density(density) { assert(osp::math::is_power_of_2(m_quantaPerUnit));