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

Public Member Functions

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

Detailed Description

Definition at line 168 of file buydialog.cpp.

Member Function Documentation

◆ operator()()

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

Definition at line 173 of file buydialog.cpp.

175  {
176  if ((item1 == nullptr) || (item2 == nullptr))
177  return false;
178 
179  const ItemDbTypeT type1 = item1->getInfo().getType();
180  const ItemDbTypeT type2 = item2->getInfo().getType();
181  if (type1 == type2)
182  return item1->getPrice() < item2->getPrice();
183  return type1 < type2;
184  }
ItemDbTypeT getType() const
Definition: iteminfo.h:127
const ItemInfo & getInfo() const
Definition: item.h:171
int getPrice() const
Definition: shopitem.h:132
ItemDbType ::T ItemDbTypeT
Definition: itemdbtype.h:49

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