GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/npchandler.h Lines: 0 1 0.0 %
Date: 2021-03-17 Branches: 0 0 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2009  The Mana World Development Team
4
 *  Copyright (C) 2009-2010  The Mana Developers
5
 *  Copyright (C) 2011-2019  The ManaPlus Developers
6
 *  Copyright (C) 2019-2021  Andrei Karas
7
 *
8
 *  This file is part of The ManaPlus Client.
9
 *
10
 *  This program is free software; you can redistribute it and/or modify
11
 *  it under the terms of the GNU General Public License as published by
12
 *  the Free Software Foundation; either version 2 of the License, or
13
 *  any later version.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *
20
 *  You should have received a copy of the GNU General Public License
21
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
 */
23
24
#ifndef NET_NPCHANDLER_H
25
#define NET_NPCHANDLER_H
26
27
#include <iosfwd>
28
29
#include "enums/being/cookingtype.h"
30
31
#include "enums/net/npcaction.h"
32
33
#include "enums/simpletypes/beingid.h"
34
#include "enums/simpletypes/itemcolor.h"
35
36
#include "utils/vector.h"
37
38
#include "localconsts.h"
39
40
class Being;
41
class NpcDialog;
42
class ShopItem;
43
44
namespace Net
45
{
46
47
class MessageIn;
48
49
class NpcHandler notfinal
50
{
51
    public:
52
        NpcHandler()
53
        { }
54
55
        A_DELETE_COPY(NpcHandler)
56
57
        virtual ~NpcHandler()
58
        { }
59
60
        virtual BeingId getNpc(Net::MessageIn &msg,
61
                               const NpcActionT action) = 0;
62
63
        virtual void talk(const Being *const being) const = 0;
64
65
        virtual void nextDialog(const BeingId npcId) const = 0;
66
67
        virtual void closeDialog(const BeingId npcId) = 0;
68
69
        virtual void listInput(const BeingId npcId,
70
                               const unsigned char value) const = 0;
71
72
        virtual void integerInput(const BeingId npcId,
73
                                  const int value) const = 0;
74
75
        virtual void stringInput(const BeingId npcId,
76
                                 const std::string &value) const = 0;
77
78
        virtual void buy(const Being *const being) const = 0;
79
80
        virtual void buy(const BeingId beingId) const = 0;
81
82
        virtual void sell(const BeingId beingId) const = 0;
83
84
        virtual void buyItem(const BeingId beingId,
85
                             const int itemId,
86
                             const ItemColor color,
87
                             const int amount) const = 0;
88
89
        virtual void buyItems(STD_VECTOR<ShopItem*> &items) const = 0;
90
91
        virtual void sellItem(const BeingId beingId,
92
                              const int itemId,
93
                              const int amount) const = 0;
94
95
        virtual void sellItems(STD_VECTOR<ShopItem*> &items) const = 0;
96
97
        virtual void completeProgressBar() const = 0;
98
99
        virtual void produceMix(const int nameId,
100
                                const int materialId1,
101
                                const int materialId2,
102
                                const int materialId3) const  = 0;
103
104
        virtual void cooking(const CookingTypeT type,
105
                             const int nameId) const = 0;
106
107
        virtual void repair(const int index) const = 0;
108
109
        virtual void refine(const int index) const = 0;
110
111
        virtual void identify(const int index) const = 0;
112
113
        virtual void selectArrow(const int nameId) const = 0;
114
115
        virtual void selectAutoSpell(const int skillId) const = 0;
116
117
        virtual void requestAirship(const std::string &mapName,
118
                                    const int itemId) const = 0;
119
120
        virtual NpcDialog *getCurrentNpcDialog() const = 0;
121
};
122
123
}  // namespace Net
124
125
extern Net::NpcHandler *npcHandler;
126
127
#endif  // NET_NPCHANDLER_H