ManaPlus
Public Member Functions
SortPartyFunctor Class Reference

Public Member Functions

bool operator() (const PartyMember *const p1, const PartyMember *const p2) const
 

Detailed Description

Definition at line 33 of file party.cpp.

Member Function Documentation

◆ operator()()

bool SortPartyFunctor::operator() ( const PartyMember *const  p1,
const PartyMember *const  p2 
) const
inline

Definition at line 38 of file party.cpp.

40  {
41  if (p1 == nullptr || p2 == nullptr)
42  return false;
43  const int leader1 = CAST_S32(p1->getLeader());
44  const int leader2 = CAST_S32(p2->getLeader());
45  if (leader1 != leader2)
46  return leader1 >= leader2;
47  if (p1->getName() != p2->getName())
48  {
49  std::string s1 = p1->getName();
50  std::string s2 = p2->getName();
51  toLower(s1);
52  toLower(s2);
53  return s1 < s2;
54  }
55  return false;
56  }
#define CAST_S32
Definition: cast.h:30
std::string getName() const
Definition: avatar.h:53
bool getLeader() const
Definition: party.h:45
std::string toLower(std::string const &s)

References CAST_S32, and Catch::toLower().


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