]> git.localhorst.tv Git - blobs.git/blobdiff - src/creature/Composition.hpp
ingest forgein materials
[blobs.git] / src / creature / Composition.hpp
index 06b1c744b51b2a94e2b961feb8222c72563c813d..da669923972a340d8c68a4219014cad105648256 100644 (file)
@@ -1,10 +1,15 @@
 #ifndef BLOBLS_CREATURE_COMPOSITION_HPP_
 #define BLOBLS_CREATURE_COMPOSITION_HPP_
 
+#include "../world/Set.hpp"
+
 #include <vector>
 
 
 namespace blobs {
+namespace world {
+       class Resource;
+}
 namespace creature {
 
 class Composition {
@@ -21,18 +26,22 @@ public:
        Composition();
        ~Composition();
 
-       Composition(const Composition &) = delete;
-       Composition &operator =(const Composition &) = delete;
+       Composition(const Composition &) = default;
+       Composition &operator =(const Composition &) = default;
 
-       Composition(Composition &&) = delete;
-       Composition &operator =(Composition &&) = delete;
+       Composition(Composition &&) = default;
+       Composition &operator =(Composition &&) = default;
 
 public:
        void Add(int res, double amount);
        bool Has(int res) const noexcept;
        double Get(int res) const noexcept;
+       double Proportion(int res) const noexcept;
+       double Compatibility(const world::Set<world::Resource> &, int res) const noexcept;
+       double TotalMass() const noexcept { return total_mass; }
 
 public:
+       std::vector<Component>::size_type size() const noexcept { return components.size(); }
        std::vector<Component>::iterator begin() noexcept { return components.begin(); }
        std::vector<Component>::iterator end() noexcept { return components.end(); }
        std::vector<Component>::const_iterator begin() const noexcept { return components.begin(); }
@@ -42,6 +51,7 @@ public:
 
 private:
        std::vector<Component> components;
+       double total_mass;
 
 };