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

Public Member Functions

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

Detailed Description

Definition at line 73 of file buydialog.cpp.

Member Function Documentation

◆ operator()()

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

Definition at line 78 of file buydialog.cpp.

80  {
81  if ((item1 == nullptr) || (item2 == nullptr))
82  return false;
83 
84  const int price1 = item1->getPrice();
85  const int price2 = item2->getPrice();
86  if (price1 == price2)
87  return item1->getDisplayName() < item2->getDisplayName();
88  return price1 < price2;
89  }
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: