ManaPlus
Public Member Functions
RequestTradeListener Struct Reference

#include <requesttradelistener.h>

Inheritance diagram for RequestTradeListener:
ActionListener

Public Member Functions

 RequestTradeListener ()
 
void action (const ActionEvent &event)
 
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()
 

Additional Inherited Members

- Protected Member Functions inherited from ActionListener
 ActionListener ()
 

Detailed Description

Listener for request trade dialogs

Definition at line 41 of file requesttradelistener.h.

Constructor & Destructor Documentation

◆ RequestTradeListener()

RequestTradeListener::RequestTradeListener ( )
inline

Definition at line 44 of file requesttradelistener.h.

45  { }

Member Function Documentation

◆ action()

void RequestTradeListener::action ( const ActionEvent actionEvent)
inlinevirtual

Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.

Parameters
actionEventThe event of the action.

Implements ActionListener.

Definition at line 49 of file requesttradelistener.h.

50  {
51  confirmDlg = nullptr;
52  const std::string &eventId = event.getId();
53  if (eventId == "ignore")
55  tradeHandler->respond(eventId == "yes");
56  }
virtual void respond(const bool accept) const
Definition: tradehandler.h:49
void ignoreTrade(const std::string &name) const
const std::string & getId() const
Definition: widget.h:919
Net::TradeHandler * tradeHandler
Definition: net.cpp:98
PlayerRelationsManager playerRelations
std::string tradePartnerName
Definition: popupmenu.cpp:101
ConfirmDialog * confirmDlg
Definition: traderecv.cpp:49

References confirmDlg, Widget::getId(), PlayerRelationsManager::ignoreTrade(), playerRelations, Net::TradeHandler::respond(), tradeHandler, and tradePartnerName.


The documentation for this struct was generated from the following file: