2 |
================= |
================= |
3 |
MAP.h |
MAP.h |
4 |
================= |
================= |
5 |
version 0.1.2 |
version 0.1.3 |
6 |
================= |
================= |
7 |
|
|
8 |
This is the main data structure for the game map. |
This is the main data structure for the game map. |
14 |
|
|
15 |
CHANGLELOG: |
CHANGLELOG: |
16 |
-------------------- |
-------------------- |
17 |
|
0.1.4 - adjusted road quality interface functions. removed elevation as a variable in map tiles |
18 |
|
0.1.3 - added tile occupations. |
19 |
0.1.2 - added road quality and fixed map intialaizer bug |
0.1.2 - added road quality and fixed map intialaizer bug |
20 |
0.1.1 - added additional obst. type enums and capitalized them as well. change code accordingly. |
0.1.1 - added additional obst. type enums and capitalized them as well. change code accordingly. |
21 |
|
|
79 |
void SetObst(short int x, short int y, short int type); // sets the obstacle type for a specific map cell at x,y coords |
void SetObst(short int x, short int y, short int type); // sets the obstacle type for a specific map cell at x,y coords |
80 |
short int GetObst(short int x, short int y); // gets the obstacle type for a specific map cell at x,y coords |
short int GetObst(short int x, short int y); // gets the obstacle type for a specific map cell at x,y coords |
81 |
|
|
82 |
void SetOccu(int x, int y, Pod& pod); |
bool SetOccu(int x, int y, Pod& pod); |
83 |
void UnsetOccu(int x, int y); |
void UnsetOccu(int x, int y); |
84 |
Pod* GetOccu(int x, int y); |
Pod* GetOccu(int x, int y); |
85 |
|
|
86 |
void TrampleRoad(int x, int y, int a=1); //reduces "roadness" by a, where a=1 unless otherwise specified |
void TrampleRoad(int x, int y, int a=1); // reduces "roadness" by a, where a=1 unless otherwise specified |
87 |
int GetRoadQ(int x, int y); // get road quality |
int GetRoadQ(int x, int y); // get road quality |
88 |
|
|
89 |
bool IsValid (short int x, short int y); |
bool IsValid (short int x, short int y); |
94 |
// map tile structure - the main gig |
// map tile structure - the main gig |
95 |
struct maptile { |
struct maptile { |
96 |
enum obstacle obst; //obstacle type |
enum obstacle obst; //obstacle type |
|
short int elev; // land elevation |
|
97 |
short int road_q; // road quality. 0-10, 10 = rough new terrain, 0 = well traveled road / fast. |
short int road_q; // road quality. 0-10, 10 = rough new terrain, 0 = well traveled road / fast. |
98 |
Pod* occu; // the pod that accupies this tile |
Pod* occu; // the pod that accupies this tile |
99 |
// specials - linked list |
// specials - linked list |