-
Notifications
You must be signed in to change notification settings - Fork 0
/
Building.cpp
50 lines (40 loc) · 851 Bytes
/
Building.cpp
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
#include "Building.h"
Building::Building()
:GameObject('B')
{
trainer_count = 0;
cout << "Building default constructed" << endl;
}
Building::Building(Point2D in_loc, int in_id, char in_code)
:GameObject(in_loc, in_id, 'B')
{
trainer_count = 0;
id_num = in_id;
location = in_loc;
display_code = in_code;
state = '0';
}
void Building::AddOneTrainer()
{
trainer_count++;
}
void Building::RemoveOneTrainer()
{
trainer_count--;
}
void Building::ShowStatus()
{
cout << "(" << display_code << ")(" << id_num << ") located at " << location << endl;
if (trainer_count == 1)
{
cout << "(" << trainer_count << ") trainer is in this building." << endl;
}
else
{
cout << "(" << trainer_count << ") trainers are in this building." << endl;
}
}
bool Building::ShouldBeVisible()
{
return true;
}