-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEnemyUnit.h
executable file
·99 lines (76 loc) · 2.19 KB
/
EnemyUnit.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*****************************************************************
COPYRIGHT (C): 2013, All Rights Reserved.
PROJECT: TowerDefense
FILE: EnemyUnit.h
PURPOSE: EnemyUnits move across a map's path and must be destroyed by a player's towers
COMPILER: i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
TARGET: Mac OS X
PROGRAMMER: Helen Wauck and Kevin Dexter
START DATE: 01/21/2013
*****************************************************************/
#ifndef ENEMYUNIT_H_
#define ENEMYUNIT_H_
#include <string>
#include "type.h"
#include "tower.h"
#include "Square.h"
class EnemyUnit {
public:
EnemyUnit();
EnemyUnit(std::string name, int speed, Type type, int goldReward, int scoreReward, int maxHealth, std::string color, Square square);
/* PURPOSE: moves this unit to the specified Square
*/
void move(Square square);
void takeDamage(Tower tower);
bool isDead();
/* PURPOSE: Draws this unit on the map
*/
void drawUnit();
void setName(std::string name);
void setSpeed(int speed);
void setType(Type type);
void setGoldReward(int goldReward);
void setScoreReward(int scoreReward);
void setMaxHealth(int maxHealth);
void setDirection(char direction);
void setColor(std::string color);
void setSquare(Square square);
std::string getName();
int getSpeed();
Type getType();
int getGoldReward();
int getScoreReward();
int getMaxHealth();
int getHealth();
char getDirection();
std::string getColor();
Square getSquare();
int getDistanceTraveled();
private:
std::string name;
int speed;
Type type;
/* REMARKS: The gold the player receives when this unit is killed
*/
int goldReward;
/* REMARKS: The points the player receives when this unit is killed
*/
int scoreReward;
/* REMARKS: The maximum health a unit can have
*/
int maxHealth;
/* REMARKS: The unit's current health
*/
int health;
/* REMARKS: The direction this unit is currently travelling in (n, s, e, w,)
*/
char direction;
std::string color;
/* REMARKS: The Square this unit is currently on
*/
Square square;
/* REMARKS: The total number of squares this unit has occupied
*/
int distanceTraveled;
};
#endif /* ENEMYUNIT_H_ */