2005-05-12 13:59:22 -07:00
|
|
|
#ifndef __MAP_H__
|
|
|
|
|
#define __MAP_H__
|
2005-05-11 22:16:59 -07:00
|
|
|
|
2005-05-22 19:52:37 -07:00
|
|
|
#include "area.h"
|
|
|
|
|
#include "areapainter.h"
|
|
|
|
|
#include "areaplacer.h"
|
|
|
|
|
#include "constraint.h"
|
|
|
|
|
#include "entity.h"
|
|
|
|
|
|
2005-05-11 22:16:59 -07:00
|
|
|
class Map {
|
|
|
|
|
public:
|
2005-05-12 17:54:10 -07:00
|
|
|
int size;
|
|
|
|
|
int** terrain;
|
|
|
|
|
float** height;
|
2005-05-22 19:52:37 -07:00
|
|
|
Area*** area;
|
2005-05-12 17:54:10 -07:00
|
|
|
std::map<std::string, int> nameToId;
|
|
|
|
|
std::map<int, std::string> idToName;
|
2005-05-22 19:52:37 -07:00
|
|
|
std::vector<Entity*> entities;
|
|
|
|
|
std::vector<Area*> areas;
|
2005-05-11 22:16:59 -07:00
|
|
|
|
2005-05-12 17:54:10 -07:00
|
|
|
Map(int size, const std::string& baseTerrain, float baseHeight);
|
|
|
|
|
~Map();
|
2005-05-11 22:16:59 -07:00
|
|
|
|
2005-05-12 17:54:10 -07:00
|
|
|
int getId(std::string terrain);
|
2005-05-12 17:39:13 -07:00
|
|
|
|
2005-05-12 17:54:10 -07:00
|
|
|
bool validT(int x, int y);
|
|
|
|
|
bool validH(int x, int y);
|
2005-05-12 17:39:13 -07:00
|
|
|
|
2005-05-12 17:54:10 -07:00
|
|
|
std::string getTerrain(int x, int y);
|
|
|
|
|
void setTerrain(int x, int y, const std::string& terrain);
|
2005-05-12 17:39:13 -07:00
|
|
|
|
2005-05-12 17:54:10 -07:00
|
|
|
float getHeight(int x, int y);
|
|
|
|
|
void setHeight(int x, int y, float height);
|
2005-05-22 19:52:37 -07:00
|
|
|
|
|
|
|
|
void addEntity(class Entity* ent);
|
|
|
|
|
|
|
|
|
|
Area* createArea(AreaPlacer* placer, AreaPainter* painter, Constraint* constr);
|
2005-05-12 13:59:22 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|