summaryrefslogtreecommitdiff
path: root/graphs/cpp/caste_or_cast/provider.hh
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:08:27 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:08:27 +0200
commitc9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch)
tree3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /graphs/cpp/caste_or_cast/provider.hh
add: graphs et rushs
Diffstat (limited to 'graphs/cpp/caste_or_cast/provider.hh')
-rw-r--r--graphs/cpp/caste_or_cast/provider.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/graphs/cpp/caste_or_cast/provider.hh b/graphs/cpp/caste_or_cast/provider.hh
new file mode 100644
index 0000000..5076585
--- /dev/null
+++ b/graphs/cpp/caste_or_cast/provider.hh
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "worker.hh"
+
+//! forward declaration
+class Nurturer;
+
+/*
+ * Provider worker sub-caste :
+ * harvest Food in the Outside World and transmit it to
+ * Nurturers ants
+ */
+class Provider : public Worker
+{
+public:
+ //! inherit Worker Constructors
+ using Worker::Worker;
+ //! final override of the work() Worker virtual method
+ void work() override final;
+ //! transfer food to Nurturer workers only
+ void transferFood(Nurturer& nurturer);
+ /*!
+ * @details final override of the communicate() Ant virtual method
+ * @return true if the communication succeeded
+ * */
+ bool communicate(std::weak_ptr<Ant> wk_receiver) override final;
+ //! go to the outside world and harvest food
+ void harvestFood();
+};