-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProperty.h
76 lines (66 loc) · 1.92 KB
/
Property.h
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
#ifndef _PROPERTY_H_
#define _PROPERTY_H_
#include <string>
#include <iostream>
#include <vector>
#include <memory>
#include "Building.h"
#include "Player.h"
#include "Exception.h"
// base class for all Property buildings
class Property: public Building {
// basic information of the building
std::shared_ptr<Player> owner;
unsigned int purchaseCost;
std::string monopoly;
bool mortgage;
public:
// constructor
Property(std::string name, int position, std::shared_ptr<Player> owner, unsigned int p, std::string monopoly);
// destructor
virtual ~Property() = 0;
// accessor
std::shared_ptr<Player> getOwner();
// mutator
void setOwner(std::shared_ptr<Player> owner);
// accessor
unsigned int getPurchaseCost();
// accessor
std::string getMonopoly();
// mutator
void setMortgage(bool m);
// determines if the building has been mortgaged
bool Mortgage();
};
// Academic
class Academic : public Property {
// basic information
private:
unsigned int improvement;
unsigned int improvementCost;
std::vector<unsigned int> tuition;
public:
Academic(std::string name, int position, std::shared_ptr<Player> owner, std::string monopoly,
unsigned int p, unsigned int improvementCost, std::vector<unsigned int > tuition);
unsigned int getImprovement();
unsigned int getImprovementCost();
unsigned int getTuition();
virtual void accept(Player & p) override;
void improve(std::string s);
void setImprovement(int improvement);
};
// Gym
class Gym: public Property {
public:
Gym(std::string name, int position, std::shared_ptr<Player> owner);
unsigned int getFee(Player & p);
virtual void accept(Player & p) override;
};
// Residence
class Residence: public Property {
public:
Residence(std::string name, int position, std::shared_ptr<Player> owner);
unsigned int getRent();
virtual void accept(Player & p) override;
};
#endif