Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | List of all members
cDungeonRoom Class Reference
Inheritance diagram for cDungeonRoom:
Inheritance graph
[legend]
Collaboration diagram for cDungeonRoom:
Collaboration graph
[legend]

Public Member Functions

 cDungeonRoom (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, int a_HalfSizeX, int a_HalfSizeZ, int a_FloorHeight, cNoise &a_Noise)
 
- Public Member Functions inherited from cGridStructGen::cStructure
 cStructure (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ)
 Creates a structure that has its origin set at the specified coords. More...
 
virtual size_t GetCacheCost (void) const
 Returns the cost of keeping this structure in the cache. More...
 
virtual ~cStructure ()
 

Protected Member Functions

Vector3i DecodeChestCoords (int a_PosIdx, int a_SizeX, int a_SizeZ)
 Decodes the position index along the room walls into a proper 2D position for a chest. More...
 
virtual void DrawIntoChunk (cChunkDesc &a_ChunkDesc) override
 Draws self into the specified chunk. More...
 
void ReplaceCuboid (cChunkDesc &a_ChunkDesc, int a_StartX, int a_StartY, int a_StartZ, int a_EndX, int a_EndY, int a_EndZ, BLOCKTYPE a_DstBlockType)
 Fills the specified area of blocks in the chunk with the specified blocktype if they are one of the overwritten block types. More...
 
void ReplaceCuboidRandom (cChunkDesc &a_ChunkDesc, int a_StartX, int a_StartY, int a_StartZ, int a_EndX, int a_EndY, int a_EndZ, BLOCKTYPE a_DstBlockType1, BLOCKTYPE a_DstBlockType2)
 Fills the specified area of blocks in the chunk with a random pattern of the specified blocktypes, if they are one of the overwritten block types. More...
 
void TryPlaceChest (cChunkDesc &a_ChunkDesc, const Vector3i &a_Chest)
 Tries to place a chest at the specified (absolute) coords. More...
 

Protected Attributes

Vector3i m_Chest1
 The (absolute) coords of the first chest. More...
 
Vector3i m_Chest2
 The (absolute) coords of the second chest. More...
 
int m_EndX
 
int m_EndZ
 
int m_FloorHeight
 The Y coord of the floor of the room. More...
 
eMonsterType m_MonsterType
 The monster type for the mobspawner entity. More...
 
int m_StartX
 
int m_StartZ
 

Private Types

using Super = cGridStructGen::cStructure
 

Additional Inherited Members

- Public Attributes inherited from cGridStructGen::cStructure
int m_GridX
 The grid point for which the structure is generated. More...
 
int m_GridZ
 
int m_OriginX
 The origin (the coords for which the structure is generated) More...
 
int m_OriginZ
 

Detailed Description

Definition at line 27 of file DungeonRoomsFinisher.cpp.

Member Typedef Documentation

◆ Super

Definition at line 30 of file DungeonRoomsFinisher.cpp.

Constructor & Destructor Documentation

◆ cDungeonRoom()

cDungeonRoom::cDungeonRoom ( int  a_GridX,
int  a_GridZ,
int  a_OriginX,
int  a_OriginZ,
int  a_HalfSizeX,
int  a_HalfSizeZ,
int  a_FloorHeight,
cNoise a_Noise 
)
inline

Definition at line 34 of file DungeonRoomsFinisher.cpp.

Member Function Documentation

◆ DecodeChestCoords()

Vector3i cDungeonRoom::DecodeChestCoords ( int  a_PosIdx,
int  a_SizeX,
int  a_SizeZ 
)
inlineprotected

Decodes the position index along the room walls into a proper 2D position for a chest.

The Y coord of the returned vector specifies the chest's meta value.

Definition at line 103 of file DungeonRoomsFinisher.cpp.

◆ DrawIntoChunk()

virtual void cDungeonRoom::DrawIntoChunk ( cChunkDesc a_ChunkDesc)
inlineoverrideprotectedvirtual

Draws self into the specified chunk.

Implements cGridStructGen::cStructure.

Definition at line 239 of file DungeonRoomsFinisher.cpp.

◆ ReplaceCuboid()

void cDungeonRoom::ReplaceCuboid ( cChunkDesc a_ChunkDesc,
int  a_StartX,
int  a_StartY,
int  a_StartZ,
int  a_EndX,
int  a_EndY,
int  a_EndZ,
BLOCKTYPE  a_DstBlockType 
)
inlineprotected

Fills the specified area of blocks in the chunk with the specified blocktype if they are one of the overwritten block types.

The coords are absolute, start coords are inclusive, end coords are exclusive.

Definition at line 131 of file DungeonRoomsFinisher.cpp.

◆ ReplaceCuboidRandom()

void cDungeonRoom::ReplaceCuboidRandom ( cChunkDesc a_ChunkDesc,
int  a_StartX,
int  a_StartY,
int  a_StartZ,
int  a_EndX,
int  a_EndY,
int  a_EndZ,
BLOCKTYPE  a_DstBlockType1,
BLOCKTYPE  a_DstBlockType2 
)
inlineprotected

Fills the specified area of blocks in the chunk with a random pattern of the specified blocktypes, if they are one of the overwritten block types.

The coords are absolute, start coords are inclusive, end coords are exclusive. The first blocktype uses 75% chance, the second 25% chance.

Definition at line 158 of file DungeonRoomsFinisher.cpp.

◆ TryPlaceChest()

void cDungeonRoom::TryPlaceChest ( cChunkDesc a_ChunkDesc,
const Vector3i a_Chest 
)
inlineprotected

Tries to place a chest at the specified (absolute) coords.

Does nothing if the coords are outside the chunk.

Definition at line 187 of file DungeonRoomsFinisher.cpp.

Member Data Documentation

◆ m_Chest1

Vector3i cDungeonRoom::m_Chest1
protected

The (absolute) coords of the first chest.

The Y coord represents the chest's Meta value (facing).

Definition at line 92 of file DungeonRoomsFinisher.cpp.

◆ m_Chest2

Vector3i cDungeonRoom::m_Chest2
protected

The (absolute) coords of the second chest.

The Y coord represents the chest's Meta value (facing).

Definition at line 95 of file DungeonRoomsFinisher.cpp.

◆ m_EndX

int cDungeonRoom::m_EndX
protected

Definition at line 83 of file DungeonRoomsFinisher.cpp.

◆ m_EndZ

int cDungeonRoom::m_EndZ
protected

Definition at line 86 of file DungeonRoomsFinisher.cpp.

◆ m_FloorHeight

int cDungeonRoom::m_FloorHeight
protected

The Y coord of the floor of the room.

Definition at line 89 of file DungeonRoomsFinisher.cpp.

◆ m_MonsterType

eMonsterType cDungeonRoom::m_MonsterType
protected

The monster type for the mobspawner entity.

Definition at line 98 of file DungeonRoomsFinisher.cpp.

◆ m_StartX

int cDungeonRoom::m_StartX
protected

Definition at line 83 of file DungeonRoomsFinisher.cpp.

◆ m_StartZ

int cDungeonRoom::m_StartZ
protected

Definition at line 86 of file DungeonRoomsFinisher.cpp.


The documentation for this class was generated from the following file: