-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActor.hpp
More file actions
78 lines (61 loc) · 1.31 KB
/
Actor.hpp
File metadata and controls
78 lines (61 loc) · 1.31 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Actor.hpp
*
* Created on: Mar 7, 2014
* Author: stolee
*/
#ifndef ACTOR_HPP_
#define ACTOR_HPP_
#include "GraphMap.hpp"
// These actor types can be combined to form bitmasks.
#define ACTOR_HERO 1
#define ACTOR_ENEMY 2
#define ACTOR_EATABLE 4
#define ACTOR_POWERUP 8
#define ACTOR_DEAD 16
class GameManager;
class Melee;
class Actor
{
friend class GameManager;
friend class Melee;
private:
int type;
int iteration;
/**
* This will possibly change the type, so you can modify your behavior!
*/
void setType( int type );
public:
Actor( int type );
/**
* Destructor
*/
virtual ~Actor();
/**
* This is the most important method to implement!
*
* Return the index of the neighbor within the list of neighbors.
*/
virtual int selectNeighbor( GraphMap* map, int cur_x, int cur_y );
/**
* What is the character to use to indicate this actor?
*/
virtual unsigned char getImage();
/**
* Create a new copy of this actor, in the right inherited type!
*/
virtual Actor* duplicate();
int getType();
/**
* Report your netid through your code.
*
* Useful for later, secret purposes.
*/
virtual const char* getNetId();
/**
* Report the name of the actor
*/
virtual const char* getActorId();
};
#endif /* ACTOR_HPP_ */