-
Notifications
You must be signed in to change notification settings - Fork 0
/
Location.h
47 lines (44 loc) · 1.33 KB
/
Location.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
#ifndef LOCATION_H
#define LOCATION_H
#include "LocalArea.h"
class Location
{
public:
/** Default constructor */
Location(LocalArea&, int X = 0, int Y = 0);
/** Default destructor */
virtual ~Location();
/** Access x
* \return The current value of x
*/
int getX() { return x; }
/** Set x
* \param val New value to set
*/
void setX(int val) { x = val; }
/** Access y
* \return The current value of y
*/
int getY() { return y; }
/** Set y
* \param val New value to set
*/
void setY(int val) { y = val; }
void move(int X, int Y) {x += X; y += Y;}
/** Access localArea
* \return The current value of localArea
*/
LocalArea& getLocalArea() {return *localArea;}
/** Set localArea
* \param val New value to set
*/
void setLocalArea(LocalArea val) { localArea = &val; }
const TerrainType* getTerrain() {return getLocalArea().getTerrain(getX(), getY());}
bool correct();
protected:
private:
LocalArea* localArea; //!< Member variable "localArea"
int x; //!< Member variable "x"
int y; //!< Member variable "y"
};
#endif // LOCATION_H