Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
DungeonGen Class Reference

#include <dungeongen.h>

+ Collaboration diagram for DungeonGen:

Public Member Functions

 DungeonGen (const NodeDefManager *ndef, GenerateNotifier *gennotify, DungeonParams *dparams)
 
void generate (MMVManip *vm, u32 bseed, v3s16 full_node_min, v3s16 full_node_max)
 
void makeDungeon (v3s16 start_padding)
 
void makeRoom (v3s16 roomsize, v3s16 roomplace)
 
void makeCorridor (v3s16 doorplace, v3s16 doordir, v3s16 &result_place, v3s16 &result_dir)
 
void makeDoor (v3s16 doorplace, v3s16 doordir)
 
void makeFill (v3s16 place, v3s16 size, u8 avoid_flags, MapNode n, u8 or_flags)
 
void makeHole (v3s16 place)
 
bool findPlaceForDoor (v3s16 &result_place, v3s16 &result_dir)
 
bool findPlaceForRoomDoor (v3s16 roomsize, v3s16 &result_doorplace, v3s16 &result_doordir, v3s16 &result_roomplace)
 
void randomizeDir ()
 

Public Attributes

MMVManipvm = nullptr
 
const NodeDefManagerndef
 
GenerateNotifiergennotify
 
u32 blockseed
 
PseudoRandom random
 
v3s16 csize
 
content_t c_torch
 
DungeonParams dp
 
v3s16 m_pos
 
v3s16 m_dir
 

Constructor & Destructor Documentation

◆ DungeonGen()

Member Function Documentation

◆ findPlaceForDoor()

bool DungeonGen::findPlaceForDoor ( v3s16 & result_place,
v3s16 & result_dir )

References DungeonParams::c_wall, VoxelArea::contains(), CONTENT_AIR, dp, MapNode::getContent(), VoxelManipulator::getNodeNoExNoEmerge(), VoxelManipulator::m_area, m_dir, m_pos, p(), randomizeDir(), and vm.

Referenced by findPlaceForRoomDoor(), and makeDungeon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findPlaceForRoomDoor()

bool DungeonGen::findPlaceForRoomDoor ( v3s16 roomsize,
v3s16 & result_doorplace,
v3s16 & result_doordir,
v3s16 & result_roomplace )

References VoxelArea::contains(), findPlaceForDoor(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_flags, p(), random, PseudoRandom::range(), vm, and VMANIP_FLAG_DUNGEON_INSIDE.

Referenced by makeDungeon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate()

void DungeonGen::generate ( MMVManip * vm,
u32 bseed,
v3s16 full_node_min,
v3s16 full_node_max )

◆ makeCorridor()

void DungeonGen::makeCorridor ( v3s16 doorplace,
v3s16 doordir,
v3s16 & result_place,
v3s16 & result_dir )

References DungeonParams::c_stair, DungeonParams::c_wall, VoxelArea::contains(), CONTENT_AIR, DungeonParams::corridor_len_max, DungeonParams::corridor_len_min, dir(), dir_to_facedir(), dp, MapNode::getContent(), DungeonParams::holesize, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, makeFill(), makeHole(), PseudoRandom::next(), p(), random, random_turn(), PseudoRandom::range(), turn_xz(), vm, VMANIP_FLAG_DUNGEON_INSIDE, and VMANIP_FLAG_DUNGEON_UNTOUCHABLE.

Referenced by makeDungeon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeDoor()

void DungeonGen::makeDoor ( v3s16 doorplace,
v3s16 doordir )

References c_torch, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, makeHole(), and vm.

Referenced by makeDungeon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeDungeon()

void DungeonGen::makeDungeon ( v3s16 start_padding)

◆ makeFill()

void DungeonGen::makeFill ( v3s16 place,
v3s16 size,
u8 avoid_flags,
MapNode n,
u8 or_flags )

References VoxelArea::contains(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, p(), and vm.

Referenced by makeCorridor(), and makeHole().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeHole()

void DungeonGen::makeHole ( v3s16 place)

References CONTENT_AIR, dp, DungeonParams::holesize, makeFill(), and VMANIP_FLAG_DUNGEON_INSIDE.

Referenced by makeCorridor(), and makeDoor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeRoom()

void DungeonGen::makeRoom ( v3s16 roomsize,
v3s16 roomplace )

References DungeonParams::c_wall, VoxelArea::contains(), CONTENT_AIR, dp, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, p(), vm, and VMANIP_FLAG_DUNGEON_UNTOUCHABLE.

Referenced by makeDungeon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ randomizeDir()

void DungeonGen::randomizeDir ( )
inline

References DungeonParams::diagonal_dirs, dp, m_dir, rand_ortho_dir(), and random.

Referenced by findPlaceForDoor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ blockseed

u32 DungeonGen::blockseed

Referenced by generate().

◆ c_torch

content_t DungeonGen::c_torch

Referenced by DungeonGen(), makeDoor(), and makeDungeon().

◆ csize

v3s16 DungeonGen::csize

◆ dp

◆ gennotify

GenerateNotifier* DungeonGen::gennotify

Referenced by DungeonGen(), and makeDungeon().

◆ m_dir

v3s16 DungeonGen::m_dir

◆ m_pos

v3s16 DungeonGen::m_pos

Referenced by findPlaceForDoor(), and makeDungeon().

◆ ndef

const NodeDefManager* DungeonGen::ndef

Referenced by DungeonGen(), and generate().

◆ random

◆ vm


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