ManaPlus
anonymous_namespace{buydialog.cpp}
SortItemWeightFunctor
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
}
ItemInfo::getWeight
int getWeight() const
Definition:
iteminfo.h:133
Item::getInfo
const ItemInfo & getInfo() const
Definition:
item.h:171
ShopItem::getPrice
int getPrice() const
Definition:
shopitem.h:132
The documentation for this class was generated from the following file:
src/gui/windows/
buydialog.cpp (986a3bf)
Generated on Wed Mar 17 2021 19:19:17 for ManaPlus by
1.9.1