Loosened the requirements for constructing a MapPager
This is so that I can configure the size of the pages in the config.cfg file.
This commit is contained in:
@@ -62,7 +62,3 @@ Region* RegionPagerBase::GetRegion(int x, int y) {
|
||||
if (ptr) return ptr;
|
||||
return CreateRegion(x, y);
|
||||
}
|
||||
|
||||
void RegionPagerBase::Update() {
|
||||
//TODO
|
||||
}
|
||||
|
||||
+13
-10
@@ -29,15 +29,13 @@
|
||||
|
||||
class RegionPagerBase {
|
||||
public:
|
||||
RegionPagerBase() = delete;
|
||||
RegionPagerBase() = default;
|
||||
RegionPagerBase(int regionWidth, int regionHeight, int regionDepth);
|
||||
virtual ~RegionPagerBase();
|
||||
|
||||
int SetTile(int x, int y, int z, int v);
|
||||
int GetTile(int x, int y, int z);
|
||||
|
||||
void Update();
|
||||
|
||||
Region* GetRegion(int x, int y);
|
||||
|
||||
//interface
|
||||
@@ -47,20 +45,25 @@ public:
|
||||
virtual void UnloadRegion(int x, int y) = 0;
|
||||
|
||||
//accessors
|
||||
int GetRegionWidth() { return regionWidth; }
|
||||
int GetRegionHeight() { return regionHeight; }
|
||||
int GetRegionDepth() { return regionDepth; }
|
||||
//NOTE: don't change the sizes mid-program, it will cause issues
|
||||
int SetRegionWidth(int i) { return regionWidth = i; }
|
||||
int SetRegionHeight(int i) { return regionHeight = i; }
|
||||
int SetRegionDepth(int i) { return regionDepth = i; }
|
||||
|
||||
int GetRegionWidth() const { return regionWidth; }
|
||||
int GetRegionHeight() const { return regionHeight; }
|
||||
int GetRegionDepth() const { return regionDepth; }
|
||||
protected:
|
||||
const int regionWidth;
|
||||
const int regionHeight;
|
||||
const int regionDepth;
|
||||
int regionWidth;
|
||||
int regionHeight;
|
||||
int regionDepth;
|
||||
std::list<Region*> regionList;
|
||||
};
|
||||
|
||||
template<typename MapGenerator, typename MapFileFormat>
|
||||
class RegionPager : public RegionPagerBase {
|
||||
public:
|
||||
RegionPager() = delete;
|
||||
RegionPager() = default;
|
||||
RegionPager(int w, int h, int d):
|
||||
RegionPagerBase(w, h, d)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user