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

Public Member Functions

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

Detailed Description

Definition at line 130 of file buydialog.cpp.

Member Function Documentation

◆ operator()()

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

Definition at line 135 of file buydialog.cpp.

137  {
138  if ((item1 == nullptr) || (item2 == nullptr))
139  return false;
140 
141  const int weight1 = item1->getInfo().getWeight();
142  const int weight2 = item2->getInfo().getWeight();
143  if (weight1 == weight2)
144  return item1->getPrice() < item2->getPrice();
145  return weight1 < weight2;
146  }
int getWeight() const
Definition: iteminfo.h:133
const ItemInfo & getInfo() const
Definition: item.h:171
int getPrice() const
Definition: shopitem.h:132

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