ManaPlus
Public Member Functions
anonymous_namespace{buydialog.cpp}::SortItemNameFunctor Class Reference

Public Member Functions

bool operator() (const ShopItem *const item1, const ShopItem *const item2) const
 

Detailed Description

Definition at line 92 of file buydialog.cpp.

Member Function Documentation

◆ operator()()

bool anonymous_namespace{buydialog.cpp}::SortItemNameFunctor::operator() ( const ShopItem *const  item1,
const ShopItem *const  item2 
) const
inline

Definition at line 97 of file buydialog.cpp.

99  {
100  if ((item1 == nullptr) || (item2 == nullptr))
101  return false;
102 
103  const std::string &name1 = item1->getDisplayName();
104  const std::string &name2 = item2->getDisplayName();
105  if (name1 == name2)
106  return item1->getPrice() < item2->getPrice();
107  return name1 < name2;
108  }
const std::string & getDisplayName() const
Definition: shopitem.h:140
int getPrice() const
Definition: shopitem.h:132

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