aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StructureStart.h
blob: 720353677399f84bcc29e537b884b44ea94ce910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
class StructurePiece;
class BoundingBox;

#include "StructureFeatureIO.h"

class StructureStart
{
public:
	list<StructurePiece *> pieces;

protected:
	BoundingBox *boundingBox;

private:
	int chunkX, chunkZ;

public:
	StructureStart();
	StructureStart(int x, int z);
	~StructureStart();
	BoundingBox *getBoundingBox();
	list<StructurePiece *> *getPieces();
	void postProcess(Level *level, Random *random, BoundingBox *chunkBB);
protected:
	void calculateBoundingBox();

public:
	virtual CompoundTag *createTag(int chunkX, int chunkZ);
	virtual void addAdditonalSaveData(CompoundTag *tag);
	virtual void load(Level *level, CompoundTag *tag);
	virtual void readAdditonalSaveData(CompoundTag *tag);

protected:
	void moveBelowSeaLevel(Level *level, Random *random, int offset);
	void moveInsideHeights(Level *level, Random *random, int lowestAllowed, int highestAllowed);
public:
	bool isValid();
	int getChunkX();
	int getChunkZ();

	virtual EStructureStart GetType() = 0;
};