forked from ivogeorg/ucd-csci2312-pa4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Agent.h
40 lines (25 loc) · 800 Bytes
/
Agent.h
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
30
31
32
33
34
35
36
37
38
39
40
//
// Created by Ivo Georgiev on 11/22/15.
//
#ifndef PA5GAME_AGENT_H
#define PA5GAME_AGENT_H
#include "Game.h"
#include "Piece.h"
namespace Gaming {
class Agent : public Piece {
protected:
double __energy;
public:
static const double AGENT_FATIGUE_RATE;
Agent(const Game &g, const Position &p, double energy);
~Agent();
double getEnergy() const { return __energy; }
void addEnergy(double e) { __energy += e; }
void age() override final;
bool isViable() const override final { return !isFinished() && __energy > 0.0; }
Piece &operator*(Piece &other) override final;
Piece &interact(Agent *) override final;
Piece &interact(Resource *) override final;
};
}
#endif //PA5GAME_AGENT_H