Skip to content

Commit db77ff7

Browse files
authored
Update Building.h
1 parent 1fe3977 commit db77ff7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Building.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55
#include <algorithm>
66
#include <iostream>
77

8-
class Player;
8+
class Player; // forward declaration
99

10+
// abstract class of buildings
1011
class Building {
12+
// basic information of the building
1113
private:
1214
std::string name;
1315
int position;
1416
public:
17+
// constructor
1518
Building(std::string name, int position);
19+
// accessor
1620
std::string getName();
21+
// accessor
1722
int getPosition();
23+
// virtual method for visitor pattern
1824
virtual void accept(Player & p) = 0;
1925
};
2026

0 commit comments

Comments
 (0)