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

#include <statlistener.h>

Inheritance diagram for StatListener:
MiniStatusWindow StatsPage StatsPageBasic

Public Member Functions

virtual void statChanged (const AttributesT id, const int oldVal1, const int oldVal2)=0
 
 StatListener ()
 
virtual ~ StatListener ()
 

Static Public Member Functions

static void distributeEvent (const AttributesT id, const int oldVal1, const int oldVal2)
 
static void addListener (StatListener *const listener)
 
static void removeListener (const StatListener *const listener)
 

Static Private Attributes

static std::vector< StatListener * > mListeners
 

Detailed Description

Definition at line 31 of file statlistener.h.

Constructor & Destructor Documentation

◆ StatListener()

StatListener::StatListener ( )

Definition at line 28 of file statlistener.cpp.

◆ ~ StatListener()

virtual StatListener::~ StatListener ( )
virtual

Member Function Documentation

◆ addListener()

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

Definition at line 28 of file statlistener.cpp.

◆ distributeEvent()

void StatListener::distributeEvent ( const AttributesT  id,
const int  oldVal1,
const int  oldVal2 
)
static

Definition at line 30 of file statlistener.cpp.

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

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

Referenced by PlayerInfo::triggerStat().

◆ removeListener()

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

Definition at line 28 of file statlistener.cpp.

◆ statChanged()

virtual void StatListener::statChanged ( const AttributesT  id,
const int  oldVal1,
const int  oldVal2 
)
pure virtual

Implemented in MiniStatusWindow, StatsPageBasic, and StatsPage.

Field Documentation

◆ mListeners

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

Definition at line 44 of file statlistener.h.


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