summaryrefslogtreecommitdiff
path: root/graphs/cpp/caste_or_cast/provider.hh
blob: 507658542165eac4e9a6a55f9109c3ce61e54cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
};