#include "stdafx.h" #include "rmgen.h" #include "map.h" #include "entity.h" using namespace std; Map::Map(int size, const string& baseTerrain, float baseHeight) { if(size<0 || size>1024) { JS_ReportError(cx, "init: map size out of range"); } else if(size%16 != 0) { JS_ReportError(cx, "init: map size must be divisble by 16"); } this->size = size; int baseId = getId(baseTerrain); terrain = new int*[size]; for(int i=0; i=0 && y>=0 && x=0 && y>=0 && x points; if(!placer->place(this, constr, points)) { return 0; } Area* a = new Area(points); for(int i=0; ipaint(this, a); return a; }