ManaPlus
Public Member Functions
anonymous_namespace{itemcontainer.cpp}::SortItemIdFunctor Class Reference

Public Member Functions

bool operator() (const ItemIdPair *const pair1, const ItemIdPair *const pair2) const
 

Detailed Description

Definition at line 112 of file itemcontainer.cpp.

Member Function Documentation

◆ operator()()

bool anonymous_namespace{itemcontainer.cpp}::SortItemIdFunctor::operator() ( const ItemIdPair *const  pair1,
const ItemIdPair *const  pair2 
) const
inline

Definition at line 117 of file itemcontainer.cpp.

119  {
120  if ((pair1->mItem == nullptr) || (pair2->mItem == nullptr))
121  return false;
122 
123  const int id1 = pair1->mItem->getId();
124  const int id2 = pair2->mItem->getId();
125  if (id1 == id2)
126  {
127  return pair1->mItem->getInvIndex() <
128  pair2->mItem->getInvIndex();
129  }
130  return id1 < id2;
131  }

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