]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/Composition.hpp
aggression
[blobs.git] / src / creature / Composition.hpp
index 969407f89b1ff7d42e6cf7c3a6dfef43699a9d9a..243c079c899bca91e9c36af607e89d00e592bc04 100644 (file)
@@ -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<world::Resource> &resources;
        std::vector<Component> components;
        double total_mass;
+       double total_volume;
        double state_mass[4];
 
 };