~ubuntu-branches/ubuntu/lucid/monopd/lucid

« back to all changes in this revision

Viewing changes to src/estate.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-02-13 18:05:30 UTC
  • Revision ID: james.westby@ubuntu.com-20040213180530-0etjgas7wosb2ben
Tags: upstream-0.9.0
ImportĀ upstreamĀ versionĀ 0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2001-2003 Rob Kaper <cap@capsi.com>,
 
2
//               2001 Erik Bourget <ebourg@cs.mcgill.ca>
 
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, write to
 
15
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
16
// Boston, MA 02111-1307, USA.
 
17
 
 
18
#ifndef MONOP_ESTATE_H
 
19
#define MONOP_ESTATE_H
 
20
 
 
21
#include <string>
 
22
#include <vector>
 
23
 
 
24
#include "gameobject.h"
 
25
 
 
26
class CardGroup;
 
27
class Estate;
 
28
class EstateGroup;
 
29
class Game;
 
30
class Player;
 
31
 
 
32
class Estate : public GameObject
 
33
{
 
34
public:
 
35
        Estate(int id, std::vector<Estate *> *);
 
36
 
 
37
        void setEstateGroup(EstateGroup *group) { m_group = group; }
 
38
        void setOwner(Player *_p) { m_owner = _p; }
 
39
        void setIcon(const std::string &icon);
 
40
        std::string icon() const;
 
41
        void setRent(int _houses, int _m) { m_rent[_houses] = _m; }
 
42
        void addMoney(int money);
 
43
        void setPayAmount(int amount);
 
44
        int payAmount();
 
45
        void setPayTarget(Estate *estate) { m_payTarget = estate; }
 
46
 
 
47
        void setTakeCardGroup(CardGroup *cardGroup);
 
48
        CardGroup *takeCardGroup();
 
49
 
 
50
        EstateGroup *group() { return m_group; }
 
51
        Player *owner() { return m_owner; }
 
52
        const std::string color();
 
53
        const std::string bgColor();
 
54
        int price();
 
55
        int housePrice();
 
56
        int rentByHouses(int _h) { return m_rent[_h]; }
 
57
        int rent(Player *player, const std::string &rentMath);
 
58
        Estate *payTarget() { return m_payTarget; }
 
59
 
 
60
        bool canBeOwned();
 
61
        bool canToggleMortgage(Player *owner);
 
62
        bool canBuyHouses(Player *);
 
63
        bool canSellHouses(Player *);
 
64
                
 
65
        int groupSize(Player *);
 
66
        int minHouses();
 
67
        int maxHouses();
 
68
        bool groupHasBuildings();
 
69
        bool groupHasMortgages();
 
70
        bool estateGroupIsMonopoly();
 
71
 
 
72
private:
 
73
        Estate *m_payTarget;
 
74
        EstateGroup *m_group;
 
75
        Player *m_owner;
 
76
        CardGroup *m_takeCardGroup;
 
77
        std::vector<Estate *> *m_estates;
 
78
        int m_rent[6];
 
79
};
 
80
 
 
81
#endif // MONOP_ESTATE_H