ManaPlus
Public Member Functions
SortGuildFunctor Class Reference

Public Member Functions

bool operator() (const GuildMember *const m1, const GuildMember *const m2) const
 

Detailed Description

Definition at line 34 of file guild.cpp.

Member Function Documentation

◆ operator()()

bool SortGuildFunctor::operator() ( const GuildMember *const  m1,
const GuildMember *const  m2 
) const
inline

Definition at line 39 of file guild.cpp.

41  {
42  if ((m1 == nullptr) || (m2 == nullptr))
43  return false;
44 
45  if (m1->getOnline() != m2->getOnline())
46  {
47  return static_cast<int>(m1->getOnline()) >=
48  static_cast<int>(m2->getOnline());
49  }
50 
51  if (m1->getPos() != m2->getPos())
52  return m1->getPos() >= m2->getPos();
53 
54  if (m1->getName() != m2->getName())
55  {
56  std::string s1 = m1->getName();
57  std::string s2 = m2->getName();
58  toLower(s1);
59  toLower(s2);
60  return s1 < s2;
61  }
62  return false;
63  }
bool getOnline() const
Definition: avatar.h:81
std::string getName() const
Definition: avatar.h:53
int getPos() const
Definition: guild.h:47
std::string toLower(std::string const &s)

References Catch::toLower().


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