GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/tmwa/guildmanager.h Lines: 0 2 0.0 %
Date: 2017-11-29 Branches: 0 0 0.0 %

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