2 |
================= |
================= |
3 |
MAP.h |
MAP.h |
4 |
================= |
================= |
5 |
version 0.1.3 |
version 0.1.4 |
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.5 July 20, 2003 |
18 |
|
- removed "dump" since t was causing compile problems and i didn't feel like fixing it :-) |
19 |
|
- Map now inserts itself into PointerHub when constructed. |
20 |
0.1.4 - adjusted road quality interface functions. removed elevation as a variable in map tiles |
0.1.4 - adjusted road quality interface functions. removed elevation as a variable in map tiles |
21 |
0.1.3 - added tile occupations. |
0.1.3 - added tile occupations. |
22 |
0.1.2 - added road quality and fixed map intialaizer bug |
0.1.2 - added road quality and fixed map intialaizer bug |
27 |
TO DO |
TO DO |
28 |
------------------- |
------------------- |
29 |
- bounds and error checking |
- bounds and error checking |
30 |
|
- dummy class constructor with no perams. function for creating map later *after* creating object. |
31 |
|
we need this to create maps in global scope before we know the perams for creating the map. |
32 |
|
(maybe) |
33 |
|
|
34 |
*/ |
*/ |
35 |
|
|
36 |
|
|
37 |
|
|
|
#include <stdio.h> |
|
|
|
|
|
|
|
38 |
|
|
39 |
#ifndef MAP_H |
#ifndef MAP_H |
40 |
#define MAP_H |
#define MAP_H |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
// defined elsewhere |
// defined elsewhere |
48 |
class Pod; |
class Pod; |
49 |
|
|
57 |
WATER, // 2 |
WATER, // 2 |
58 |
PIT, // 3 |
PIT, // 3 |
59 |
BARRIER,// 4 |
BARRIER,// 4 |
60 |
// special paint marker for tracking pathfinding or whatever: |
PAINT, // 5 - special paint marker for tracking pathfinding or whatever: |
|
PAINT, // 5 |
|
61 |
// axis home base tiles: |
// axis home base tiles: |
62 |
RED, // 6 |
RED, // 6 |
63 |
ORANGE, // 7 |
ORANGE, // 7 |
96 |
bool IsValid (short int x, short int y); |
bool IsValid (short int x, short int y); |
97 |
|
|
98 |
void PrintToScreen(void); // dump to screen |
void PrintToScreen(void); // dump to screen |
99 |
void dump(FILE* out); //dump to file |
//void dump(FILE* out); //dump to file |
100 |
private: |
private: |
101 |
// map tile structure - the main gig |
// map tile structure - the main gig |
102 |
struct maptile { |
struct maptile { |
103 |
enum obstacle obst; //obstacle type |
obstacle obst; //obstacle type |
104 |
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. |
105 |
Pod* occu; // the pod that accupies this tile |
Pod* occu; // the pod that accupies this tile |
106 |
// specials - linked list |
// specials - linked list |