-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUseSpace.cpp
46 lines (42 loc) · 1.44 KB
/
UseSpace.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
/******************************************************************************
** UseSpace Class Implementation File
** Author: Lauren "Ren" Demeis-Ortiz
** Date: 12/7/19
** Description: This is the class implementation file for the UseSpace class.
******************************************************************************/
#include "UseSpace.hpp"
#include <string>
/*****************************************************************************
** UseSpace()
** Description: Constructor
*****************************************************************************/
UseSpace::UseSpace(std::string mapName, int prevRow, int prevCol,
int nextRow, int NextCol):
Space(mapName, prevRow, prevCol, nextRow, NextCol)
{
inUse = false;
}
/*****************************************************************************
** interact(int, int)
** Description: Uses the item.
*****************************************************************************/
void UseSpace::interact(int row, int col)
{
if(inUse)
{
message = "The " + item + " is already running.\n";
}
else
{
message = "Gurgle! Let the " + item + " bring chaos!\n";
inUse = true;
}
}
/*****************************************************************************
** getStatus()
** Description: Returns inUse
*****************************************************************************/
bool UseSpace::getStatus()
{
return inUse;
}