1/**
2 * The Forgotten Server - a free and open-source MMORPG server emulator
3 * Copyright (C) 2019 Mark Samman <mark.samman@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef FS_TRASHHOLDER_H_BA162024D67B4D388147F5EE06F33098
21#define FS_TRASHHOLDER_H_BA162024D67B4D388147F5EE06F33098
22
23#include "item.h"
24#include "cylinder.h"
25#include "const.h"
26
27class TrashHolder final : public Item, public Cylinder
28{
29 public:
30 explicit TrashHolder(uint16_t itemId) : Item(itemId) {}
31
32 TrashHolder* getTrashHolder() override {
33 return this;
34 }
35 const TrashHolder* getTrashHolder() const override {
36 return this;
37 }
38
39 //cylinder implementations
40 ReturnValue queryAdd(int32_t index, const Thing& thing, uint32_t count, uint32_t flags, Creature* actor = nullptr) const override;
41 ReturnValue queryMaxCount(int32_t index, const Thing& thing, uint32_t count, uint32_t& maxQueryCount, uint32_t flags) const override;
42 ReturnValue queryRemove(const Thing& thing, uint32_t count, uint32_t flags) const override;
43 Cylinder* queryDestination(int32_t& index, const Thing& thing, Item** destItem, uint32_t& flags) override;
44
45 void addThing(Thing* thing) override;
46 void addThing(int32_t index, Thing* thing) override;
47
48 void updateThing(Thing* thing, uint16_t itemId, uint32_t count) override;
49 void replaceThing(uint32_t index, Thing* thing) override;
50
51 void removeThing(Thing* thing, uint32_t count) override;
52
53 void postAddNotification(Thing* thing, const Cylinder* oldParent, int32_t index, cylinderlink_t link = LINK_OWNER) override;
54 void postRemoveNotification(Thing* thing, const Cylinder* newParent, int32_t index, cylinderlink_t link = LINK_OWNER) override;
55};
56
57#endif
58