-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorldMap.h
More file actions
28 lines (27 loc) · 934 Bytes
/
WorldMap.h
File metadata and controls
28 lines (27 loc) · 934 Bytes
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
#ifndef WORLDMAP_H_INCLUDED
#define WORLDMAP_H_INCLUDED
#include "MapUnit.h"
#include <vector>
#include <string>
class WorldMap
{
public:
WorldMap()=default;
WorldMap(const WorldMap &wm):maps(wm.GetMaps()),mapNameList(GetMapNameList()){}
~WorldMap();
WorldMap &operator=(const WorldMap &wm);
bool ReadMapFile();
void PrintMapFile() const;
int Size(){return maps.size();}
std::vector<std::string> &GetMapNameList(){return mapNameList;}
MapUnit &operator[](int index){return *(maps[index]);}
const MapUnit &operator[](int index)const{return *(maps[index]);}
const std::vector<MapUnit*>GetMaps()const{return maps;}
const std::vector<std::string>GetMapNameList()const{return mapNameList;}
void BankRupt(int playerID);
WorldMap* Clone(){return new WorldMap(*this);}
private:
std::vector<MapUnit*> maps;
std::vector<std::string> mapNameList;
};
#endif // WORLDMAP_H_INCLUDED