Luanti 5.16.0-dev
Loading...
Searching...
No Matches
GenerateNotifier Class Reference

#include <mapgen.h>

Collaboration diagram for GenerateNotifier:

Classes

struct  GenNotifyEvent

Public Member Functions

 GenerateNotifier ()=default
 GenerateNotifier (u32 notify_on, const std::set< u32 > *notify_on_deco_ids, const std::set< std::string > *notify_on_custom)
bool addEvent (GenNotifyType type, v3s16 pos)
bool addDecorationEvent (v3s16 pos, u32 deco_id)
bool setCustom (const std::string &key, const std::string &value)
void getEvents (std::map< std::string, std::vector< v3s16 > > &map) const
const StringMapgetCustomData () const
void clearEvents ()

Private Member Functions

bool shouldNotifyOn (GenNotifyType type) const

Private Attributes

u32 m_notify_on = 0
const std::set< u32 > * m_notify_on_deco_ids = nullptr
const std::set< std::string > * m_notify_on_custom = nullptr
std::vector< GenNotifyEventm_notify_events
StringMap m_notify_custom

Constructor & Destructor Documentation

◆ GenerateNotifier() [1/2]

GenerateNotifier::GenerateNotifier ( )
default

◆ GenerateNotifier() [2/2]

GenerateNotifier::GenerateNotifier ( u32 notify_on,
const std::set< u32 > * notify_on_deco_ids,
const std::set< std::string > * notify_on_custom )

Member Function Documentation

◆ addDecorationEvent()

bool GenerateNotifier::addDecorationEvent ( v3s16 pos,
u32 deco_id )

References GENNOTIFY_DECORATION, GenerateNotifier::GenNotifyEvent::id, m_notify_events, m_notify_on_deco_ids, GenerateNotifier::GenNotifyEvent::pos, shouldNotifyOn(), and GenerateNotifier::GenNotifyEvent::type.

Referenced by Decoration::placeDeco().

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

◆ addEvent()

bool GenerateNotifier::addEvent ( GenNotifyType type,
v3s16 pos )

References GENNOTIFY_CUSTOM, GENNOTIFY_DECORATION, m_notify_events, GenerateNotifier::GenNotifyEvent::pos, shouldNotifyOn(), and GenerateNotifier::GenNotifyEvent::type.

Here is the call graph for this function:

◆ clearEvents()

void GenerateNotifier::clearEvents ( )

References m_notify_custom, and m_notify_events.

◆ getCustomData()

const StringMap & GenerateNotifier::getCustomData ( ) const
inline

References m_notify_custom.

Referenced by ModApiMapgen::l_get_mapgen_object().

Here is the caller graph for this function:

◆ getEvents()

void GenerateNotifier::getEvents ( std::map< std::string, std::vector< v3s16 > > & map) const

References flagdesc_gennotify, GENNOTIFY_CUSTOM, GENNOTIFY_DECORATION, itos(), and m_notify_events.

Referenced by ModApiMapgen::l_get_mapgen_object().

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

◆ setCustom()

bool GenerateNotifier::setCustom ( const std::string & key,
const std::string & value )

References GENNOTIFY_CUSTOM, m_notify_custom, m_notify_on_custom, and shouldNotifyOn().

Here is the call graph for this function:

◆ shouldNotifyOn()

bool GenerateNotifier::shouldNotifyOn ( GenNotifyType type) const
inlineprivate

References m_notify_on.

Referenced by addDecorationEvent(), addEvent(), and setCustom().

Here is the caller graph for this function:

Member Data Documentation

◆ m_notify_custom

StringMap GenerateNotifier::m_notify_custom
private

◆ m_notify_events

std::vector<GenNotifyEvent> GenerateNotifier::m_notify_events
private

◆ m_notify_on

u32 GenerateNotifier::m_notify_on = 0
private

Referenced by GenerateNotifier(), and shouldNotifyOn().

◆ m_notify_on_custom

const std::set<std::string>* GenerateNotifier::m_notify_on_custom = nullptr
private

Referenced by GenerateNotifier(), and setCustom().

◆ m_notify_on_deco_ids

const std::set<u32>* GenerateNotifier::m_notify_on_deco_ids = nullptr
private

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