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

Public Member Functions

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

Detailed Description

Definition at line 149 of file buydialog.cpp.

Member Function Documentation

◆ operator()()

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

Definition at line 154 of file buydialog.cpp.

156  {
157  if ((item1 == nullptr) || (item2 == nullptr))
158  return false;
159 
160  const int amount1 = item1->getQuantity();
161  const int amount2 = item2->getQuantity();
162  if (amount1 == amount2)
163  return item1->getPrice() < item2->getPrice();
164  return amount1 < amount2;
165  }
int getQuantity() const
Definition: item.h:105
int getPrice() const
Definition: shopitem.h:132

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