December 2014 files

This commit is contained in:
Loki Rautio
2026-03-01 11:00:23 -06:00
parent b691c43c44
commit 8fd3ac6e37
2049 changed files with 260190 additions and 134787 deletions

View File

@@ -1,7 +1,11 @@
#pragma once
#include "LargeFeature.h"
#include "StructureFeatureSavedData.h"
class StructureStart;
//#define ENABLE_STRUCTURE_SAVING
class StructureFeature : public LargeFeature
{
public:
@@ -15,44 +19,64 @@ public:
eFeature_Village,
};
#ifdef ENABLE_STRUCTURE_SAVING
private:
shared_ptr<StructureFeatureSavedData> savedData;
#endif
protected:
unordered_map<__int64, StructureStart *> cachedStructures;
public:
StructureFeature();
~StructureFeature();
virtual wstring getFeatureName() = 0;
virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks);
bool postProcess(Level *level, Random *random, int chunkX, int chunkZ);
bool isIntersection(int cellX, int cellZ);
bool postProcess(Level *level, Random *random, int chunkX, int chunkZ);
bool isIntersection(int cellX, int cellZ);
bool isInsideFeature(int cellX, int cellY, int cellZ);
protected:
StructureStart *getStructureAt(int cellX, int cellY, int cellZ);
public:
bool isInsideBoundingFeature(int cellX, int cellY, int cellZ);
TilePos *getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ);
protected:
vector<TilePos> *getGuesstimatedFeaturePositions();
/**
* Returns true if the given chunk coordinates should hold a structure
* source.
*
* @param x
* chunk x
* @param z
* chunk z
* @return
*/
private:
virtual void restoreSavedData(Level *level);
virtual void saveFeature(int chunkX, int chunkZ, StructureStart *feature);
/**
* Returns true if the given chunk coordinates should hold a structure
* source.
*
* @param x
* chunk x
* @param z
* chunk z
* @return
*/
protected:
virtual bool isFeatureChunk(int x, int z, bool bIsSuperflat=false) = 0;
/**
* Creates a new instance of a structure source at the given chunk
* coordinates.
*
* @param x
* chunk x
* @param z
* chunk z
* @return
*/
virtual StructureStart *createStructureStart(int x, int z) = 0;
/**
* Creates a new instance of a structure source at the given chunk
* coordinates.
*
* @param x
* chunk x
* @param z
* chunk z
* @return
*/
virtual StructureStart *createStructureStart(int x, int z) = 0;
};