-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveBehaviour.h
More file actions
52 lines (42 loc) · 1.74 KB
/
MoveBehaviour.h
File metadata and controls
52 lines (42 loc) · 1.74 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
/*
Class: MoveBehaviour
Purpose: Represents the base class for different move behaviors of participants in the simulation.
Member Functions:
- virtual void move(int oldRow, int oldCol, int& newRow, int& newCol) = 0: Pure virtual function to compute new position.
- virtual ~MoveBehaviour(): Destructor for MoveBehaviour class.
Derived Classes:
- EscapeeBehaviour: Represents the behavior of heroes before they are rescued.
- VillainBehaviour: Represents the behavior of snorcs (regular and giant).
- RescuerBehaviour: Represents the behavior of ninjas before they rescue a hero.
- RescuedBehaviour: Represents the behavior of heroes and ninjas after they are or have rescued.
*/
#ifndef MOVEBEHAVIOUR_H
#define MOVEBEHAVIOUR_H
#include "defs.h" // Include the necessary definitions
class MoveBehaviour {
public:
MoveBehaviour() = default; // Default constructor
virtual ~MoveBehaviour();
virtual void move(int oldRow, int oldCol, int& newRow, int& newCol) = 0;
};
class EscapeeBehaviour : public MoveBehaviour {
public:
EscapeeBehaviour() = default; // Default constructor
void move(int oldRow, int oldCol, int& newRow, int& newCol) override;
};
class VillainBehaviour : public MoveBehaviour {
public:
VillainBehaviour() = default; // Default constructor
void move(int oldRow, int oldCol, int& newRow, int& newCol) override;
};
class RescuerBehaviour : public MoveBehaviour {
public:
RescuerBehaviour() = default; // Default constructor
void move(int oldRow, int oldCol, int& newRow, int& newCol) override;
};
class RescuedBehaviour : public MoveBehaviour {
public:
RescuedBehaviour() = default; // Default constructor
void move(int oldRow, int oldCol, int& newRow, int& newCol) override;
};
#endif