ManaPlus
npchandler.h
Go to the documentation of this file.
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 
30 
31 #include "enums/net/npcaction.h"
32 
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 
50 {
51  public:
53  { }
54 
56 
57  virtual ~NpcHandler()
58  { }
59 
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 
126 
127 #endif // NET_NPCHANDLER_H
int BeingId
Definition: beingid.h:30
Definition: being.h:96
virtual void selectArrow(const int nameId) const =0
virtual void completeProgressBar() const =0
virtual BeingId getNpc(Net::MessageIn &msg, const NpcActionT action)=0
virtual void closeDialog(const BeingId npcId)=0
virtual void buyItems(std::vector< ShopItem * > &items) const =0
virtual void sellItems(std::vector< ShopItem * > &items) const =0
virtual void repair(const int index) const =0
virtual void stringInput(const BeingId npcId, const std::string &value) const =0
virtual void buy(const Being *const being) const =0
virtual void buyItem(const BeingId beingId, const int itemId, const ItemColor color, const int amount) const =0
virtual void sell(const BeingId beingId) const =0
virtual void talk(const Being *const being) const =0
virtual NpcDialog * getCurrentNpcDialog() const =0
virtual void sellItem(const BeingId beingId, const int itemId, const int amount) const =0
virtual void requestAirship(const std::string &mapName, const int itemId) const =0
virtual void identify(const int index) const =0
virtual void listInput(const BeingId npcId, const unsigned char value) const =0
virtual void integerInput(const BeingId npcId, const int value) const =0
virtual void produceMix(const int nameId, const int materialId1, const int materialId2, const int materialId3) const =0
virtual void nextDialog(const BeingId npcId) const =0
virtual void buy(const BeingId beingId) const =0
virtual void cooking(const CookingTypeT type, const int nameId) const =0
virtual void refine(const int index) const =0
virtual void selectAutoSpell(const int skillId) const =0
CookingType ::T CookingTypeT
Definition: cookingtype.h:36
uint16_t ItemColor
Definition: itemcolor.h:30
#define notfinal
Definition: localconsts.h:261
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
bool msg(InputEvent &event)
Definition: chat.cpp:39
NpcAction ::T NpcActionT
Definition: npcaction.h:33
Net::NpcHandler * npcHandler
Definition: net.cpp:93