-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfakeBoard.cc
49 lines (41 loc) · 1.04 KB
/
fakeBoard.cc
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
#include <iostream>
#include <string>
#include <fstream>
#include "player.h"
#include <vector>
using namespace std;
int main(){
}
/*
void canBuy(const player &p, const int cost){
return p.getMoney() >= cost
}
*/
//prints all the assets of the given player
void assets(Player &p){
vector<int> assets = p.getAssets();
cout << p.getName() << " has $" << p.getMoney() << " and owns the buildings:" << endl;
for(int a:assets){
cout << a << endl;
}
cout << "and " << p.getResNum() << " residences." << endl;
}
// saves the data to given filename as described in watopoly.pdf
void save(const string filename){
ofstream out;
out.open(filename);
out << players.size() << endl;
for(Player &p:players){
cout << p.getName() << " " << p.getPiece() << " " << p.getTims() << " " << p.getMoney()
<< " " << p.getPosition();
}
for(Building &b:buildings){
cout << b.getName() << " " << b.getOwner() << " " << b.improveCount() << endl;
}
}
//goes through the players vector to print their assets.
void all(){
for(Player &p:players){
assets(p);
}
}