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"
|
2005-07-30 13:57:18 -07:00
|
|
|
#include "object.h"
|
2005-06-06 00:46:28 -07:00
|
|
|
#include "terrain.h"
|
2005-07-24 18:31:19 -07:00
|
|
|
#include "objectgroupplacer.h"
|
2005-09-03 14:53:07 -07:00
|
|
|
#include "tileclass.h"
|
2005-05-22 19:52:37 -07:00
|
|
|
|
2005-05-11 22:16:59 -07:00
|
|
|
class Map {
|
|
|
|
|
public:
|
2005-05-22 20:51:37 -07:00
|
|
|
int size;
|
2005-06-06 00:46:28 -07:00
|
|
|
int** texture;
|
2005-07-30 13:57:18 -07:00
|
|
|
std::vector<Object*>** terrainObjects;
|
2005-05-22 20:51:37 -07:00
|
|
|
float** height;
|
|
|
|
|
Area*** area;
|
|
|
|
|
std::map<std::string, int> nameToId;
|
|
|
|
|
std::map<int, std::string> idToName;
|
2005-07-30 13:57:18 -07:00
|
|
|
std::vector<Object*> objects;
|
2005-05-22 20:51:37 -07:00
|
|
|
std::vector<Area*> areas;
|
2005-09-03 14:53:07 -07:00
|
|
|
std::vector<TileClass*> tileClasses;
|
2005-05-11 22:16:59 -07:00
|
|
|
|
2005-06-06 00:46:28 -07:00
|
|
|
Map(int size, Terrain* baseTerrain, float baseHeight);
|
2005-06-23 21:46:13 -07:00
|
|
|
Map(std::string fileName, int loadLevel);
|
2005-05-22 20:51:37 -07:00
|
|
|
~Map();
|
2005-05-11 22:16:59 -07:00
|
|
|
|
2005-06-06 00:46:28 -07:00
|
|
|
int getId(std::string texture);
|
2005-05-12 17:39:13 -07:00
|
|
|
|
2005-05-22 20:51:37 -07:00
|
|
|
bool validT(int x, int y);
|
|
|
|
|
bool validH(int x, int y);
|
2005-05-12 17:39:13 -07:00
|
|
|
|
2005-06-06 00:46:28 -07:00
|
|
|
std::string getTexture(int x, int y);
|
|
|
|
|
void setTexture(int x, int y, const std::string& texture);
|
2005-05-12 17:39:13 -07:00
|
|
|
|
2005-05-22 20:51:37 -07:00
|
|
|
float getHeight(int x, int y);
|
|
|
|
|
void setHeight(int x, int y, float height);
|
2005-05-22 19:52:37 -07:00
|
|
|
|
2005-07-30 13:57:18 -07:00
|
|
|
std::vector<Object*> getTerrainObjects(int x, int y);
|
|
|
|
|
void setTerrainObjects(int x, int y, std::vector<Object*> &objects);
|
2005-07-24 18:31:19 -07:00
|
|
|
|
2005-06-06 00:46:28 -07:00
|
|
|
void placeTerrain(int x, int y, Terrain* t);
|
|
|
|
|
|
2005-07-30 13:57:18 -07:00
|
|
|
void addObject(class Object* ent);
|
2005-05-22 19:52:37 -07:00
|
|
|
|
2005-05-22 20:51:37 -07:00
|
|
|
Area* createArea(AreaPlacer* placer, AreaPainter* painter, Constraint* constr);
|
2005-09-07 18:20:51 -07:00
|
|
|
bool createObjectGroup(ObjectGroupPlacer* placer, int player, Constraint* constr);
|
2005-09-03 14:53:07 -07:00
|
|
|
|
|
|
|
|
int createTileClass(); // returns ID of the new class
|
2005-09-07 18:20:51 -07:00
|
|
|
|
|
|
|
|
float getExactHeight(float x, float y); // get height taking into account terrain curvature
|
2005-05-12 13:59:22 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|