Mana
Loading...
Searching...
No Matches
tradehandler.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "net/tradehandler.h"
25
27
28namespace ManaServ {
29
30class TradeHandler final : public MessageHandler, public Net::TradeHandler
31{
32 public:
34
35 void handleMessage(MessageIn &msg) override;
36
43 { return mAcceptTradeRequests; }
44
51
52 void request(Being *being) override;
53
54 void respond(bool accept) override;
55
56 void addItem(Item *item, int amount) override;
57
58 void removeItem(int slotNum, int amount) override;
59
60 void setMoney(int amount) override;
61
62 void confirm() override;
63
64 void finish() override;
65
66 void cancel() override;
67
68 private:
71};
72
73} // namespace ManaServ
Definition being.h:65
Represents one or more instances of a certain item type.
Definition item.h:35
Used for parsing an incoming message from manaserv.
Definition messagein.h:37
void addItem(Item *item, int amount) override
bool acceptTradeRequests() const
Returns whether trade requests are accepted.
void setMoney(int amount) override
void request(Being *being) override
void removeItem(int slotNum, int amount) override
void respond(bool accept) override
void confirm() override
void setAcceptTradeRequests(bool acceptTradeRequests)
Sets whether trade requests are accepted.
void handleMessage(MessageIn &msg) override