X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2FComposition.hpp;h=969407f89b1ff7d42e6cf7c3a6dfef43699a9d9a;hp=da669923972a340d8c68a4219014cad105648256;hb=00f55d5b55ff993d2516f00f8d635887562983c7;hpb=d609fd0169ed442ff20fbf9f4bd187a597418b4f diff --git a/src/creature/Composition.hpp b/src/creature/Composition.hpp index da66992..969407f 100644 --- a/src/creature/Composition.hpp +++ b/src/creature/Composition.hpp @@ -2,6 +2,7 @@ #define BLOBLS_CREATURE_COMPOSITION_HPP_ #include "../world/Set.hpp" +#include "../world/Resource.hpp" #include @@ -23,7 +24,7 @@ public: }; public: - Composition(); + explicit Composition(const world::Set &); ~Composition(); Composition(const Composition &) = default; @@ -37,8 +38,10 @@ public: bool Has(int res) const noexcept; double Get(int res) const noexcept; double Proportion(int res) const noexcept; - double Compatibility(const world::Set &, int res) const noexcept; + double StateProportion(int res) const noexcept; + double Compatibility(int res) const noexcept; double TotalMass() const noexcept { return total_mass; } + double StateMass(world::Resource::State s) const noexcept { return state_mass[s]; } public: std::vector::size_type size() const noexcept { return components.size(); } @@ -50,8 +53,10 @@ public: std::vector::const_iterator cend() noexcept { return components.cend(); } private: + const world::Set &resources; std::vector components; double total_mass; + double state_mass[4]; };