Debian Codegraph @

src/tradecomponent.cpp

raw
1 // Copyright © 2002 Rob Kaper <[email protected]>
2 // 2010-2015 Sylvain Rochet <[email protected]>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // version 2 as published by the Free Software Foundation.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; see the file COPYING. If not, see
15 // <http://www.gnu.org/licenses/>.
16
17 #include "config.h"
18
19 #include <stdlib.h>
20
21 #include "player.h"
22 #include "tradecomponent.h"
23
24 TradeComponent::TradeComponent(Player *from, Player *to, GameObject *gameObject)
25 {
26 m_playerFrom = from;
27 m_playerTo = to;
28 m_object = gameObject;
29 m_money = 0;
30 }
31
32 TradeComponent::TradeComponent(Player *from, Player *to, unsigned int money)
33 {
34 m_object = 0;
35 m_playerFrom = from;
36 m_playerTo = to;
37 m_money = money;
38 }
39
40 void TradeComponent::updateTargetPlayer(Player *to)
41 {
42 m_playerTo = to;
43 }
44
45 void TradeComponent::updateMoney(unsigned int money)
46 {
47 m_money = money;
48 }