source:
network-game/common/WorldMap.h@
66906aa
Last change on this file since 66906aa was f401cac, checked in by , 12 years ago | |
---|---|
|
|
File size: 553 bytes |
Rev | Line | |
---|---|---|
[62ee2ce] | 1 | #ifndef _WORLDMAP_H |
2 | #define _WORLDMAP_H | |
[60b77d2] | 3 | |
[f401cac] | 4 | #include <string> |
5 | ||
[60b77d2] | 6 | #include <vector> |
7 | ||
8 | using namespace std; | |
9 | ||
[62ee2ce] | 10 | class WorldMap { |
[60b77d2] | 11 | public: |
12 | enum TerrainType { | |
13 | TERRAIN_NONE, | |
14 | TERRAIN_GRASS, | |
[62ee2ce] | 15 | TERRAIN_OCEAN, |
16 | TERRAIN_ROCK | |
[60b77d2] | 17 | }; |
18 | ||
19 | int width, height; | |
20 | vector<vector<TerrainType>*>* vctMap; | |
21 | ||
[62ee2ce] | 22 | WorldMap(int width, int height); |
[60b77d2] | 23 | |
[62ee2ce] | 24 | ~WorldMap(); |
[60b77d2] | 25 | |
[62ee2ce] | 26 | TerrainType getElement(int x, int y); |
[60b77d2] | 27 | void setElement(int x, int y, TerrainType type); |
28 | ||
[62ee2ce] | 29 | static WorldMap* createDefaultMap(); |
[384b7e0] | 30 | static WorldMap* loadMapFromFile(string filename); |
[60b77d2] | 31 | }; |
32 | ||
[f401cac] | 33 | #endif |
Note:
See TracBrowser
for help on using the repository browser.