GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/inventoryhandler.h Lines: 1 1 100.0 %
Date: 2017-11-29 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-2017  The ManaPlus Developers
6
 *
7
 *  This file is part of The ManaPlus Client.
8
 *
9
 *  This program is free software; you can redistribute it and/or modify
10
 *  it under the terms of the GNU General Public License as published by
11
 *  the Free Software Foundation; either version 2 of the License, or
12
 *  any later version.
13
 *
14
 *  This program is distributed in the hope that it will be useful,
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *  GNU General Public License for more details.
18
 *
19
 *  You should have received a copy of the GNU General Public License
20
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
#ifndef NET_INVENTORYHANDLER_H
24
#define NET_INVENTORYHANDLER_H
25
26
#include "enums/simpletypes/beingid.h"
27
28
#include "utils/vector.h"
29
30
#include "resources/inventory/inventory.h"
31
32
namespace Net
33
{
34
35
class InventoryHandler notfinal
36
{
37
    public:
38
        InventoryHandler()
39
152
        { }
40
41
        A_DELETE_COPY(InventoryHandler)
42
43
        virtual ~InventoryHandler()
44
        { }
45
46
        virtual void clear() const = 0;
47
48
        virtual void equipItem(const Item *const item) const = 0;
49
50
        virtual void unequipItem(const Item *const item) const = 0;
51
52
        virtual void useItem(const Item *const item) const = 0;
53
54
        virtual void useItem(const Item *const item,
55
                             const int16_t useType) const = 0;
56
57
        virtual void dropItem(const Item *const item,
58
                              const int amount) const = 0;
59
60
        virtual bool canSplit(const Item *const item) const = 0;
61
62
        virtual void splitItem(const Item *const item,
63
                               const int amount) const = 0;
64
65
        virtual void moveItem(const int oldIndex,
66
                              const int newIndex) const = 0;
67
68
        virtual void closeStorage() const = 0;
69
70
        virtual void moveItem2(const InventoryTypeT source,
71
                               const int slot,
72
                               const int amount,
73
                               const InventoryTypeT destination) const = 0;
74
75
        virtual size_t getSize(const InventoryTypeT type) const
76
                               A_WARN_UNUSED = 0;
77
78
        virtual Inventory *getStorage() const = 0;
79
80
        virtual void destroyStorage() const = 0;
81
82
        virtual void forgotStorage() const = 0;
83
84
        virtual int convertFromServerSlot(const int eAthenaSlot) const = 0;
85
86
        virtual void useCard(const Item *const item) = 0;
87
88
        virtual void insertCard(const int cardIndex,
89
                                const int itemIndex) const = 0;
90
91
        virtual void favoriteItem(const Item *const item,
92
                                  const bool favorite) const = 0;
93
94
        virtual void selectEgg(const Item *const item) const = 0;
95
96
        virtual int getProjectileSlot() const = 0;
97
98
        virtual int getItemIndex() const A_WARN_UNUSED = 0;
99
100
        virtual void selectCart(const BeingId accountId,
101
                                const int type) const = 0;
102
103
        virtual void identifyItem(const Item *const item) const = 0;
104
105
        virtual void mergeItemsAck(const STD_VECTOR<Item*> &items) const = 0;
106
107
        virtual void mergetItemsCancel() const = 0;
108
};
109
110
}  // namespace Net
111
112
extern Net::InventoryHandler *inventoryHandler;
113
114
#endif  // NET_INVENTORYHANDLER_H