summaryrefslogtreecommitdiffstats
path: root/atlantik/libatlantic/player.h
blob: f36b1e8ae18ae2978e39b08bf8960657d0193d87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright (c) 2002-2003 Rob Kaper <cap@capsi.com>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; see the file COPYING.LIB.  If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.

#ifndef LIBATLANTIC_PLAYER_H
#define LIBATLANTIC_PLAYER_H

#include <tqobject.h>
#include <tqstring.h>

#include "libatlantic_export.h"

class Estate;
class Game;

class LIBATLANTIC_EXPORT Player : public QObject
{
Q_OBJECT

public:
	Player(int playerId);

	int id() { return m_id; }
	void setGame(Game *game);
	Game *game();
	void setLocation(Estate *location);
	Estate *location() { return m_location; }
	void setDestination(Estate *destination);
	Estate *destination() { return m_destination; }
	void setIsSelf(const bool isSelf) { m_isSelf = isSelf; }
	bool isSelf() const { return m_isSelf; }
	void setBankrupt(bool bankrupt);
	bool isBankrupt() { return m_bankrupt; }
	void setHasDebt(bool hasDebt);
	bool hasDebt() { return m_hasDebt; }
	void setHasTurn(const bool hasTurn);
	bool hasTurn() const { return m_hasTurn; }
	void setCanRoll(bool canRoll);
	bool canRoll() const { return m_canRoll; }
	void setCanBuy(bool canBuy);
	bool canBuy() const { return m_canBuy; }
	void setCanAuction(bool canAuction);
	bool canAuction() const { return m_canAuction; }
	void setCanUseCard(bool canUseCard);
	bool canUseCard() const { return m_canUseCard; }
	void setInJail(const bool inJail);
	bool inJail() const { return m_inJail; }
	void setName(const TQString _n);
	TQString name() const { return m_name; }
	void setHost(const TQString &host);
	TQString host() const { return m_host; }
	void setImage(const TQString &image);
	const TQString image() const { return m_image; }
	void setMoney(unsigned int _m);
	unsigned int money() const { return m_money; }
	void update(bool force = false);

signals:
	void changed(Player *player);
	void gainedTurn();

private:
	int m_id;
	bool m_changed, m_isSelf;
	bool m_bankrupt, m_hasDebt, m_hasTurn, m_canRoll, m_canBuy, m_canAuction, m_canUseCard, m_inJail;
	unsigned int m_money;
	TQString m_name, m_host, m_image;
	Game *m_game;
	Estate *m_location, *m_destination;
};

#endif