#include <dungeongen.h>
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 | |
MMVManip * | vm = nullptr |
const NodeDefManager * | ndef |
GenerateNotifier * | gennotify |
u32 | blockseed |
PseudoRandom | random |
v3s16 | csize |
content_t | c_torch |
DungeonParams | dp |
v3s16 | m_pos |
v3s16 | m_dir |
DungeonGen::DungeonGen | ( | const NodeDefManager * | ndef, |
GenerateNotifier * | gennotify, | ||
DungeonParams * | dparams ) |
References DungeonParams::c_alt_wall, DungeonParams::c_stair, c_torch, DungeonParams::c_wall, DungeonParams::corridor_len_max, DungeonParams::corridor_len_min, DungeonParams::diagonal_dirs, dp, gennotify, GENNOTIFY_DUNGEON, NodeDefManager::getId(), DungeonParams::holesize, DungeonParams::large_room_chance, ndef, DungeonParams::notifytype, DungeonParams::np_alt_wall, DungeonParams::num_dungeons, DungeonParams::num_rooms, DungeonParams::only_in_ground, DungeonParams::room_size_large_max, DungeonParams::room_size_large_min, DungeonParams::room_size_max, DungeonParams::room_size_min, and DungeonParams::seed.
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().
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().
References blockseed, DungeonParams::c_alt_wall, DungeonParams::c_wall, VoxelManipulator::clearFlags(), CONTENT_IGNORE, dp, ContentFeatures::drawtype, NodeDefManager::get(), MapNode::getContent(), VoxelArea::index(), ContentFeatures::is_ground_content, VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, makeDungeon(), MAP_BLOCKSIZE, ndef, NDT_AIRLIKE, NDT_LIQUID, NoisePerlin3D(), DungeonParams::np_alt_wall, DungeonParams::num_dungeons, DungeonParams::only_in_ground, random, PseudoRandom::seed(), MapNode::setContent(), vm, VMANIP_FLAG_DUNGEON_INSIDE, and VMANIP_FLAG_DUNGEON_PRESERVE.
Referenced by MapgenBasic::generateDungeons(), and MapgenV6::makeChunk().
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().
References c_torch, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, makeHole(), and vm.
Referenced by makeDungeon().
void DungeonGen::makeDungeon | ( | v3s16 | start_padding | ) |
References GenerateNotifier::addEvent(), c_torch, CONTENT_IGNORE, dp, findPlaceForDoor(), findPlaceForRoomDoor(), gennotify, MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), DungeonParams::large_room_chance, VoxelManipulator::m_area, VoxelManipulator::m_data, m_dir, VoxelManipulator::m_flags, m_pos, makeCorridor(), makeDoor(), makeRoom(), VoxelArea::MinEdge, DungeonParams::notifytype, DungeonParams::num_rooms, p(), random, PseudoRandom::range(), DungeonParams::room_size_large_max, DungeonParams::room_size_large_min, DungeonParams::room_size_max, DungeonParams::room_size_min, vm, and VMANIP_FLAG_DUNGEON_UNTOUCHABLE.
Referenced by generate().
References VoxelArea::contains(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, p(), and vm.
Referenced by makeCorridor(), and makeHole().
void DungeonGen::makeHole | ( | v3s16 | place | ) |
References CONTENT_AIR, dp, DungeonParams::holesize, makeFill(), and VMANIP_FLAG_DUNGEON_INSIDE.
Referenced by makeCorridor(), and makeDoor().
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().
|
inline |
References DungeonParams::diagonal_dirs, dp, m_dir, rand_ortho_dir(), and random.
Referenced by findPlaceForDoor().
u32 DungeonGen::blockseed |
Referenced by generate().
content_t DungeonGen::c_torch |
Referenced by DungeonGen(), makeDoor(), and makeDungeon().
v3s16 DungeonGen::csize |
DungeonParams DungeonGen::dp |
Referenced by DungeonGen(), findPlaceForDoor(), generate(), makeCorridor(), makeDungeon(), makeHole(), makeRoom(), and randomizeDir().
GenerateNotifier* DungeonGen::gennotify |
Referenced by DungeonGen(), and makeDungeon().
v3s16 DungeonGen::m_dir |
Referenced by findPlaceForDoor(), makeDungeon(), and randomizeDir().
v3s16 DungeonGen::m_pos |
Referenced by findPlaceForDoor(), and makeDungeon().
const NodeDefManager* DungeonGen::ndef |
Referenced by DungeonGen(), and generate().
PseudoRandom DungeonGen::random |
Referenced by findPlaceForRoomDoor(), generate(), makeCorridor(), makeDungeon(), and randomizeDir().
MMVManip* DungeonGen::vm = nullptr |
Referenced by findPlaceForDoor(), findPlaceForRoomDoor(), generate(), makeCorridor(), makeDoor(), makeDungeon(), makeFill(), and makeRoom().