-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpace.h
53 lines (44 loc) · 1.28 KB
/
Space.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
//
// Created by mfbut on 1/20/2018.
//
#ifndef HOARDINGCPPVERSION_SPACE_H
#define HOARDINGCPPVERSION_SPACE_H
#include <memory>
#include <vector>
#include "CSVReader.h"
#include "Rules.h"
#include "Go.h"
#include "Property.h"
namespace Monopoly {
class Player;
class GameState;
enum class SpaceType { goSpace, propertySpace, GotoJailSpace, JailSpace, FreeParkingSpace, PayBankSpace };
class Space {
public:
static unsigned long length_of_longest_space_name;
Space(CSVReader& boardFile, const int spaceNumber, GameState& gameState);
int getSpaceNumber() const;
void display() const;
const std::string& getName() const;
void addPlayer(Player& player);
void removePlayer(const Player& player);
void removeAllPlayers();
SpaceType getSpaceType() const;
virtual void activate(Player& activatingPlayer) = 0;
virtual int getSalary() const = 0;
int getCost() const;
int getSetId() const;
int getIntraSetId() const;
int getBasicRent() const;
private:
SpaceType spaceType;
std::unique_ptr<Go> goPtr;
std::unique_ptr<FreeParking> freeParking;
std::
std::unique_ptr<Property> propertyPtr;
std::vector<Player*> playersOnSpace;
int spaceNumber;
GameState& gameState;
};
}
#endif //HOARDINGCPPVERSION_SPACE_H