ManaPlus
Public Member Functions | Static Public Member Functions | Static Private Attributes
AttributeListener Class Referenceabstract

#include <attributelistener.h>

Inheritance diagram for AttributeListener:
ChatWindow DialogsManager InventoryWindow KillStats LocalPlayer MiniStatusWindow StatsPage StatsPageBasic StatusWindow

Public Member Functions

virtual void attributeChanged (const AttributesT id, const int64_t oldVal, const int64_t newVal)=0
 
 AttributeListener ()
 
virtual ~ AttributeListener ()
 

Static Public Member Functions

static void distributeEvent (const AttributesT id, const int64_t oldVal, const int64_t newVal)
 
static void addListener (AttributeListener *const listener)
 
static void removeListener (const AttributeListener *const listener)
 

Static Private Attributes

static std::vector< AttributeListener * > mListeners
 

Detailed Description

Definition at line 31 of file attributelistener.h.

Constructor & Destructor Documentation

◆ AttributeListener()

AttributeListener::AttributeListener ( )

Definition at line 28 of file attributelistener.cpp.

◆ ~ AttributeListener()

virtual AttributeListener::~ AttributeListener ( )
virtual

Member Function Documentation

◆ addListener()

void AttributeListener::addListener ( AttributeListener *const  listener)
static

Definition at line 28 of file attributelistener.cpp.

◆ attributeChanged()

virtual void AttributeListener::attributeChanged ( const AttributesT  id,
const int64_t  oldVal,
const int64_t  newVal 
)
pure virtual

◆ distributeEvent()

void AttributeListener::distributeEvent ( const AttributesT  id,
const int64_t  oldVal,
const int64_t  newVal 
)
static

Definition at line 30 of file attributelistener.cpp.

33 {
34  FOR_EACH (STD_VECTOR<AttributeListener*>::iterator,
35  it, mListeners)
36  {
37  AttributeListener *const listener = *it;
38  if (listener != nullptr)
39  listener->attributeChanged(id, oldVal, newVal);
40  }
41 }
static std::vector< AttributeListener * > mListeners
#define FOR_EACH(type, iter, array)
Definition: foreach.h:25

References FOR_EACH, and anonymous_namespace{itemlinkhandler.cpp}::listener.

Referenced by PlayerInfo::triggerAttr().

◆ removeListener()

void AttributeListener::removeListener ( const AttributeListener *const  listener)
static

Definition at line 28 of file attributelistener.cpp.

Field Documentation

◆ mListeners

std::vector< AttributeListener * > AttributeListener::mListeners
staticprivate

Definition at line 44 of file attributelistener.h.


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