GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/inventoryhandler.h Lines: 1 1 100.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_INVENTORYHANDLER_H
25
#define NET_INVENTORYHANDLER_H
26
27
#include "enums/simpletypes/beingid.h"
28
29
#include "utils/vector.h"
30
31
#include "resources/inventory/inventory.h"
32
33
namespace Net
34
{
35
36
class InventoryHandler notfinal
37
{
38
    public:
39
        InventoryHandler()
40
77
        { }
41
42
        A_DELETE_COPY(InventoryHandler)
43
44
        virtual ~InventoryHandler()
45
        { }
46
47
        virtual void clear() const = 0;
48
49
        virtual void equipItem(const Item *const item) const = 0;
50
51
        virtual void unequipItem(const Item *const item) const = 0;
52
53
        virtual void useItem(const Item *const item) const = 0;
54
55
        virtual void useItem(const Item *const item,
56
                             const int16_t useType) const = 0;
57
58
        virtual void dropItem(const Item *const item,
59
                              const int amount) const = 0;
60
61
        virtual bool canSplit(const Item *const item) const = 0;
62
63
        virtual void splitItem(const Item *const item,
64
                               const int amount) const = 0;
65
66
        virtual void moveItem(const int oldIndex,
67
                              const int newIndex) const = 0;
68
69
        virtual void closeStorage() const = 0;
70
71
        virtual void moveItem2(const InventoryTypeT source,
72
                               const int slot,
73
                               const int amount,
74
                               const InventoryTypeT destination) const = 0;
75
76
        virtual size_t getSize(const InventoryTypeT type) const
77
                               A_WARN_UNUSED = 0;
78
79
        virtual Inventory *getStorage() const = 0;
80
81
        virtual void destroyStorage() const = 0;
82
83
        virtual void forgotStorage() const = 0;
84
85
        virtual int convertFromServerSlot(const int eAthenaSlot) const = 0;
86
87
        virtual void useCard(const Item *const item) = 0;
88
89
        virtual void insertCard(const int cardIndex,
90
                                const int itemIndex) const = 0;
91
92
        virtual void favoriteItem(const Item *const item,
93
                                  const bool favorite) const = 0;
94
95
        virtual void selectEgg(const Item *const item) const = 0;
96
97
        virtual int getProjectileSlot() const = 0;
98
99
        virtual int getItemIndex() const A_WARN_UNUSED = 0;
100
101
        virtual void selectCart(const BeingId accountId,
102
                                const int type) const = 0;
103
104
        virtual void identifyItem(const Item *const item) const = 0;
105
106
        virtual void mergeItemsAck(const STD_VECTOR<Item*> &items) const = 0;
107
108
        virtual void mergetItemsCancel() const = 0;
109
110
        virtual void expandInventory() const = 0;
111
112
        virtual void expandInventoryConfirm() const = 0;
113
114
        virtual void expandInventoryReject() const = 0;
115
};
116
117
}  // namespace Net
118
119
extern Net::InventoryHandler *inventoryHandler;
120
121
#endif  // NET_INVENTORYHANDLER_H