ManaPlus
guildmanager.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef NET_TMWA_GUILDMANAGER_H
23 #define NET_TMWA_GUILDMANAGER_H
24 
25 #ifdef TMWA_SUPPORT
26 
27 #include "utils/stringvector.h"
28 
29 #include "localconsts.h"
30 
31 class ChatTab;
32 class Guild;
33 class EmulateGuildTab;
34 
36 {
37  public:
38  GuildManager();
39 
41 
42  ~GuildManager();
43 
44  static void init();
45 
46  void chat(const std::string &msg);
47 
48  static void send(const std::string &msg);
49 
50  static void getNames(StringVect &names);
51 
52  void requestGuildInfo();
53 
54  void updateList();
55 
57  { return mEnableGuildBot; }
58 
59  static void kick(const std::string &msg);
60 
61  static void invite(const std::string &msg);
62 
63  static void leave();
64 
65  static void notice(const std::string &msg);
66 
67  void createTab(Guild *const guild);
68 
70 
71  static void clear();
72 
73  void reload();
74 
75  static void inviteResponse(const bool response);
76 
77  bool afterRemove();
78 
79  void slowLogic();
80 
81  bool havePower() const A_WARN_UNUSED
82  { return mHavePower; }
83 
84  ChatTab *getTab();
85 
86  bool processGuildMessage(const std::string &msg);
87 
88  private:
89  bool process(std::string msg);
90 
91  static bool mEnableGuildBot;
92  bool mGotInfo;
93  bool mGotName;
96  bool mHavePower;
99  bool mRequest;
100  time_t mRequestTime;
102 };
103 
104 extern GuildManager *guildManager;
105 
106 #endif // TMWA_SUPPORT
107 #endif // NET_TMWA_GUILDMANAGER_H
static void clear()
StringVect mTempList
Definition: guildmanager.h:97
bool process(std::string msg)
static void init()
bool mGotOnlineInfo
Definition: guildmanager.h:101
ChatTab * getTab()
static bool mEnableGuildBot
Definition: guildmanager.h:91
static void inviteResponse(const bool response)
void createTab(Guild *const guild)
bool mSentNameRequest
Definition: guildmanager.h:95
bool mSentInfoRequest
Definition: guildmanager.h:94
bool havePower() const
Definition: guildmanager.h:81
static void notice(const std::string &msg)
void chat(const std::string &msg)
static void leave()
static bool getEnableGuildBot()
Definition: guildmanager.h:56
static void send(const std::string &msg)
bool afterRemove()
bool processGuildMessage(const std::string &msg)
static void kick(const std::string &msg)
static void invite(const std::string &msg)
static void getNames(StringVect &names)
time_t mRequestTime
Definition: guildmanager.h:100
EmulateGuildTab * mTab
Definition: guildmanager.h:98
static Guild * createGuild()
void requestGuildInfo()
Definition: guild.h:70
GuildManager * guildManager
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
uint32_t guild
bool msg(InputEvent &event)
Definition: chat.cpp:39
std::vector< std::string > StringVect
Definition: stringvector.h:29