X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcreature%2FComposition.hpp;h=243c079c899bca91e9c36af607e89d00e592bc04;hb=HEAD;hp=969407f89b1ff7d42e6cf7c3a6dfef43699a9d9a;hpb=00f55d5b55ff993d2516f00f8d635887562983c7;p=blobs.git 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]; };