X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2FComposition.hpp;h=243c079c899bca91e9c36af607e89d00e592bc04;hp=969407f89b1ff7d42e6cf7c3a6dfef43699a9d9a;hb=cead4f0686af352cdbac1f2c2df9b6a21ad9faec;hpb=7e02b21428efa3ebec14a34d0c1f81e81d362bfc diff --git a/src/creature/Composition.hpp b/src/creature/Composition.hpp index 969407f..243c079 100644 --- a/src/creature/Composition.hpp +++ b/src/creature/Composition.hpp @@ -41,6 +41,8 @@ public: double StateProportion(int res) const noexcept; double Compatibility(int res) const noexcept; double TotalMass() const noexcept { return total_mass; } + double TotalVolume() const noexcept { return total_volume; } + double TotalDensity() const noexcept { return total_mass / total_volume; } double StateMass(world::Resource::State s) const noexcept { return state_mass[s]; } public: @@ -56,6 +58,7 @@ private: const world::Set &resources; std::vector components; double total_mass; + double total_volume; double state_mass[4]; };