| 1 |
// Copyright © 2001-2003 Rob Kaper <[email protected]>, |
| 2 |
// 2001 Erik Bourget <[email protected]> |
| 3 |
// 2010-2015 Sylvain Rochet <[email protected]> |
| 4 |
// |
| 5 |
// This program is free software; you can redistribute it and/or |
| 6 |
// modify it under the terms of the GNU General Public License |
| 7 |
// version 2 as published by the Free Software Foundation. |
| 8 |
// |
| 9 |
// This program is distributed in the hope that it will be useful, |
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
// General Public License for more details. |
| 13 |
// |
| 14 |
// You should have received a copy of the GNU General Public License |
| 15 |
// along with this program; see the file COPYING. If not, see |
| 16 |
// <http://www.gnu.org/licenses/>. |
| 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 |