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

#include <playerdeathlistener.h>

Inheritance diagram for PlayerDeathListener:
DialogsManager LocalPlayer

Public Member Functions

virtual void playerDeath ()=0
 
 PlayerDeathListener ()
 
virtual ~ PlayerDeathListener ()
 

Static Public Member Functions

static void distributeEvent ()
 
static void addListener (PlayerDeathListener *const listener)
 
static void removeListener (const PlayerDeathListener *const listener)
 

Static Private Attributes

static std::vector< PlayerDeathListener * > mListeners
 

Detailed Description

Definition at line 29 of file playerdeathlistener.h.

Constructor & Destructor Documentation

◆ PlayerDeathListener()

PlayerDeathListener::PlayerDeathListener ( )

Definition at line 28 of file playerdeathlistener.cpp.

◆ ~ PlayerDeathListener()

virtual PlayerDeathListener::~ PlayerDeathListener ( )
virtual

Member Function Documentation

◆ addListener()

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

Definition at line 28 of file playerdeathlistener.cpp.

◆ distributeEvent()

void PlayerDeathListener::distributeEvent ( )
static

Definition at line 30 of file playerdeathlistener.cpp.

31 {
32  FOR_EACH (STD_VECTOR<PlayerDeathListener*>::iterator,
33  it, mListeners)
34  {
35  PlayerDeathListener *const listener = *it;
36  if (listener != nullptr)
37  listener->playerDeath();
38  }
39 }
static std::vector< PlayerDeathListener * > mListeners
#define FOR_EACH(type, iter, array)
Definition: foreach.h:25

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

Referenced by LocalPlayer::attributeChanged().

◆ playerDeath()

virtual void PlayerDeathListener::playerDeath ( )
pure virtual

Implemented in DialogsManager, and LocalPlayer.

◆ removeListener()

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

Definition at line 28 of file playerdeathlistener.cpp.

Field Documentation

◆ mListeners

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

Definition at line 38 of file playerdeathlistener.h.


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