ManaPlus
Functions
BadgesDB Namespace Reference

Functions

void load ()
 
void unload ()
 
const std::string getGuildBadge (const std::string &name)
 
const std::string getNameBadge (const std::string &name)
 
const std::string getPartyBadge (const std::string &name)
 
const std::string getClanBadge (const std::string &name)
 

Function Documentation

◆ getClanBadge()

const std::string BadgesDB::getClanBadge ( const std::string &  name)

Definition at line 120 of file badgesdb.cpp.

121 {
122  const BadgesInfosIter it = mClans.find(name);
123  if (it == mClans.end())
124  return std::string();
125  return (*it).second;
126 }
BadgesInfos::const_iterator BadgesInfosIter
Definition: badgesdb.h:31

References anonymous_namespace{badgesdb.cpp}::mClans.

Referenced by Being::showClanBadge().

◆ getGuildBadge()

const std::string BadgesDB::getGuildBadge ( const std::string &  name)

Definition at line 112 of file badgesdb.cpp.

113 {
114  const BadgesInfosIter it = mGuilds.find(name);
115  if (it == mGuilds.end())
116  return std::string();
117  return (*it).second;
118 }

References anonymous_namespace{badgesdb.cpp}::mGuilds.

Referenced by Being::showGuildBadge().

◆ getNameBadge()

const std::string BadgesDB::getNameBadge ( const std::string &  name)

Definition at line 104 of file badgesdb.cpp.

105 {
106  const BadgesInfosIter it = mNames.find(name);
107  if (it == mNames.end())
108  return std::string();
109  return (*it).second;
110 }

References anonymous_namespace{badgesdb.cpp}::mNames.

Referenced by Being::showNameBadge().

◆ getPartyBadge()

const std::string BadgesDB::getPartyBadge ( const std::string &  name)

Definition at line 96 of file badgesdb.cpp.

97 {
98  const BadgesInfosIter it = mParties.find(name);
99  if (it == mParties.end())
100  return std::string();
101  return (*it).second;
102 }

References anonymous_namespace{badgesdb.cpp}::mParties.

Referenced by Being::showPartyBadge().

◆ load()

void BadgesDB::load ( )

Definition at line 74 of file badgesdb.cpp.

75 {
76  if (mLoaded)
77  unload();
78 
79  logger->log1("Initializing Badges database...");
80  loadDB("guild", mGuilds);
81  loadDB("name", mNames);
82  loadDB("party", mParties);
83  loadDB("clan", mClans);
84 }
static void loadDB(const std::string &name, BadgesInfos &arr)
Definition: badgesdb.cpp:58
void log1(const char *const log_text)
Definition: logger.cpp:238
Logger * logger
Definition: logger.cpp:89
void unload()
Definition: net.cpp:180

References loadDB(), Logger::log1(), logger, anonymous_namespace{badgesdb.cpp}::mClans, anonymous_namespace{badgesdb.cpp}::mGuilds, anonymous_namespace{badgesdb.cpp}::mLoaded, anonymous_namespace{badgesdb.cpp}::mNames, anonymous_namespace{badgesdb.cpp}::mParties, and Net::unload().

Referenced by DbManager::loadDb().

◆ unload()

void BadgesDB::unload ( )