aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MineShaftPieces.h
blob: 5f9cf000ede8f4ffe8a67d25c3ce478a66c4de54 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once

#include "StructurePiece.h"

class MineShaftPieces
{
private:
	static const int DEFAULT_SHAFT_WIDTH = 3;
	static const int DEFAULT_SHAFT_HEIGHT = 3;
	static const int DEFAULT_SHAFT_LENGTH = 5;

	static const int MAX_DEPTH = 8; // 1.2.3 change

	static StructurePiece *createRandomShaftPiece(list<StructurePiece *> *pieces, Random *random, int footX, int footY, int footZ, int direction, int genDepth);
	static StructurePiece *generateAndAddPiece(StructurePiece *startPiece, list<StructurePiece *> *pieces, Random *random, int footX, int footY, int footZ, int direction, int depth);

	/**
	* 
	*
	*/
public:
	class MineShaftRoom : public StructurePiece
	{
	private:
		list<BoundingBox *> childEntranceBoxes;

	public:
		MineShaftRoom(int genDepth, Random *random, int west, int north);
		~MineShaftRoom();

		virtual void addChildren(StructurePiece *startPiece, list<StructurePiece *> *pieces, Random *random);
		virtual bool postProcess(Level *level, Random *random, BoundingBox *chunkBB);
	};

	/**
	* 
	*
	*/
	class MineShaftCorridor : public StructurePiece
	{
	private:
		bool hasRails; // was final
		bool spiderCorridor; // was final
		bool hasPlacedSpider;
		int numSections;

	public:
		MineShaftCorridor(int genDepth, Random *random, BoundingBox *corridorBox, int direction);

		static BoundingBox *findCorridorSize(list<StructurePiece *> *pieces, Random *random, int footX, int footY, int footZ, int direction);
		virtual void addChildren(StructurePiece *startPiece, list<StructurePiece *> *pieces, Random *random);
		virtual bool postProcess(Level *level, Random *random, BoundingBox *chunkBB);
	};

	/**
	* 
	*
	*/
	class MineShaftCrossing : public StructurePiece
	{
	private:
		const int direction;
		const bool isTwoFloored;

	public:
		MineShaftCrossing(int genDepth, Random *random, BoundingBox *crossingBox, int direction);

		static BoundingBox *findCrossing(list<StructurePiece *> *pieces, Random *random, int footX, int footY, int footZ, int direction);
		virtual void addChildren(StructurePiece *startPiece, list<StructurePiece *> *pieces, Random *random);
		virtual bool postProcess(Level *level, Random *random, BoundingBox *chunkBB);
	};

	/**
	* 
	*
	*/
	class MineShaftStairs : public StructurePiece
	{
	public:
		MineShaftStairs(int genDepth, Random *random, BoundingBox *stairsBox, int direction);

		static BoundingBox *findStairs(list<StructurePiece *> *pieces, Random *random, int footX, int footY, int footZ, int direction);
		virtual void addChildren(StructurePiece *startPiece, list<StructurePiece *> *pieces, Random *random);
		virtual bool postProcess(Level *level, Random *random, BoundingBox *chunkBB);

	};

	/* @formatter:off */
private:
	static WeighedTreasureArray smallTreasureItems;
	/* @formatter:on */

public:
	static void staticCtor();

};