-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBreakSpace.cpp
48 lines (44 loc) · 1.58 KB
/
BreakSpace.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
/******************************************************************************
** BreakSpace Class Implementation File
** Author: Lauren "Ren" Demeis-Ortiz
** Date: 12/7/19
** Description: This is the class implementation file for the BreakSpace class.
******************************************************************************/
#include "BreakSpace.hpp"
#include <string>
/*****************************************************************************
** BreakSpace()
** Description: Constructor
*****************************************************************************/
BreakSpace::BreakSpace(std::string mapName, int prevRow, int prevCol,
int nextRow, int NextCol) :
Space(mapName, prevRow, prevCol, nextRow, NextCol)
{
isBroken = false;
}
/*****************************************************************************
** interact(int, int)
** Description: Returns message depending on interaction.
*****************************************************************************/
void BreakSpace::interact(int row, int col)
{
if(isBroken)
{
message = "Crash! Another bat at the " + item +
" and more shattered glass\n";
}
else
{
message = "Crash!!"
"No glass will survive your chaos! At least not this " + item + ".\n";
isBroken = true;
}
}
/*****************************************************************************
** getStatus()
** Description: Returns isBroken
*****************************************************************************/
bool BreakSpace::getStatus()
{
return isBroken;
}