source: network-game/common/WorldMap.h@ 2864d8e

Last change on this file since 2864d8e was e76055f, checked in by dportnoy <dmp1488@…>, 11 years ago

The server now checks if a player got close enough to a flag to pick it up

  • Property mode set to 100644
File size: 780 bytes
Line 
1#ifndef _WORLDMAP_H
2#define _WORLDMAP_H
3
4#include <string>
5
6#include <vector>
7
8using namespace std;
9
10class WorldMap {
11public:
12 enum TerrainType {
13 TERRAIN_NONE,
14 TERRAIN_GRASS,
15 TERRAIN_OCEAN,
16 TERRAIN_ROCK
17 };
18
19 enum ObjectType {
20 OBJECT_NONE,
21 OBJECT_BLUE_FLAG,
22 OBJECT_RED_FLAG
23 };
24
25 int width, height;
26 vector<vector<TerrainType>*>* vctMap;
27 vector<vector<ObjectType>*>* vctObjects;
28
29 WorldMap(int width, int height);
30
31 ~WorldMap();
32
33 TerrainType getElement(int x, int y);
34 void setElement(int x, int y, TerrainType type);
35
36 ObjectType getObject(int x, int y);
37 void setObject(int x, int y, ObjectType type);
38
39 static WorldMap* createDefaultMap();
40 static WorldMap* loadMapFromFile(string filename);
41};
42
43#endif
Note: See TracBrowser for help on using the repository browser.