Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
Decoration Class Referenceabstract

#include <mg_decoration.h>

+ Inheritance diagram for Decoration:
+ Collaboration diagram for Decoration:

Public Member Functions

 Decoration ()=default
 
virtual ~Decoration ()=default
 
virtual void resolveNodeNames ()
 
bool canPlaceDecoration (MMVManip *vm, v3s16 p)
 
size_t placeDeco (Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
 
virtual size_t generate (MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling)=0
 
- Public Member Functions inherited from ObjDef
virtual ~ObjDef ()=default
 
virtual ObjDefclone () const =0
 
- Public Member Functions inherited from NodeResolver
 NodeResolver ()
 
virtual ~NodeResolver ()
 
void cloneTo (NodeResolver *res) const
 
bool getIdFromNrBacklog (content_t *result_out, const std::string &node_alt, content_t c_fallback, bool error_on_fallback=true)
 
bool getIdsFromNrBacklog (std::vector< content_t > *result_out, bool all_required=false, content_t c_fallback=CONTENT_IGNORE)
 
bool isResolveDone () const
 
void reset (bool resolve_done=false)
 

Public Attributes

u32 flags = 0
 
int mapseed = 0
 
std::vector< content_tc_place_on
 
s16 sidelen = 1
 
s16 y_min
 
s16 y_max
 
float fill_ratio = 0.0f
 
NoiseParams np
 
std::vector< content_tc_spawnby
 
s16 nspawnby
 
s16 place_offset_y = 0
 
s16 check_offset = -1
 
std::unordered_set< biome_tbiomes
 
- Public Attributes inherited from ObjDef
u32 index
 
u32 uid
 
ObjDefHandle handle
 
std::string name
 
- Public Attributes inherited from NodeResolver
std::vector< std::string > m_nodenames
 
std::vector< size_t > m_nnlistsizes
 

Protected Member Functions

void cloneTo (Decoration *def) const
 
- Protected Member Functions inherited from ObjDef
void cloneTo (ObjDef *def) const
 

Additional Inherited Members

- Protected Attributes inherited from NodeResolver
const NodeDefManagerm_ndef = nullptr
 
u32 m_nodenames_idx = 0
 

Constructor & Destructor Documentation

◆ Decoration()

Decoration::Decoration ( )
default

◆ ~Decoration()

virtual Decoration::~Decoration ( )
virtualdefault

Member Function Documentation

◆ canPlaceDecoration()

bool Decoration::canPlaceDecoration ( MMVManip * vm,
v3s16 p )

References ARRLEN, c_place_on, c_spawnby, check_offset, CONTAINS, VoxelArea::contains(), MapNode::getContent(), ObjDef::index, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, nspawnby, and p().

Referenced by DecoLSystem::generate(), DecoSchematic::generate(), and DecoSimple::generate().

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

◆ cloneTo()

void Decoration::cloneTo ( Decoration * def) const
protected

References biomes, c_place_on, c_spawnby, check_offset, ObjDef::cloneTo(), fill_ratio, flags, mapseed, np, nspawnby, place_offset_y, sidelen, y_max, and y_min.

Referenced by DecoLSystem::clone(), DecoSchematic::clone(), and DecoSimple::clone().

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

◆ generate()

virtual size_t Decoration::generate ( MMVManip * vm,
PcgRandom * pr,
v3s16 p,
bool ceiling )
pure virtual

Implemented in DecoLSystem, DecoSchematic, and DecoSimple.

Referenced by placeDeco().

+ Here is the caller graph for this function:

◆ placeDeco()

size_t Decoration::placeDeco ( Mapgen * mg,
u32 blockseed,
v3s16 nmin,
v3s16 nmax )

References GenerateNotifier::addDecorationEvent(), Mapgen::biomemap, biomes, DECO_ALL_CEILINGS, DECO_ALL_FLOORS, DECO_LIQUID_SURFACE, DECO_USE_NOISE, fill_ratio, Mapgen::findGroundLevel(), Mapgen::findLiquidSurface(), flags, generate(), Mapgen::gennotify, Mapgen::getSurfaces(), Mapgen::heightmap, ObjDef::index, mapseed, MAX_MAP_GENERATION_LIMIT, NoisePerlin2D(), np, PcgRandom::range(), sidelen, Mapgen::vm, and y_max.

Referenced by DecorationManager::placeAllDecos().

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

◆ resolveNodeNames()

void Decoration::resolveNodeNames ( )
virtual

Implements NodeResolver.

Reimplemented in DecoSimple.

References c_place_on, c_spawnby, and NodeResolver::getIdsFromNrBacklog().

Referenced by DecoSimple::resolveNodeNames().

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

Member Data Documentation

◆ biomes

std::unordered_set<biome_t> Decoration::biomes

◆ c_place_on

std::vector<content_t> Decoration::c_place_on

◆ c_spawnby

std::vector<content_t> Decoration::c_spawnby

◆ check_offset

s16 Decoration::check_offset = -1

◆ fill_ratio

float Decoration::fill_ratio = 0.0f

◆ flags

◆ mapseed

int Decoration::mapseed = 0

Referenced by cloneTo(), and placeDeco().

◆ np

◆ nspawnby

s16 Decoration::nspawnby

◆ place_offset_y

s16 Decoration::place_offset_y = 0

◆ sidelen

s16 Decoration::sidelen = 1

◆ y_max

s16 Decoration::y_max

◆ y_min

s16 Decoration::y_min

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