-
Notifications
You must be signed in to change notification settings - Fork 0
/
exitSpace.cpp
40 lines (35 loc) · 933 Bytes
/
exitSpace.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
/*********************************************************************
** Program name: exitSpace.hpp
** Author: Jesse McKenna
** Date: 12/5/2017
** Description: Represents the exit in the game; if the player reaches
** the exit space, the player wins the game.
*********************************************************************/
#include "exitSpace.hpp"
#include "player.hpp"
#include "symbols.hpp"
#include <iostream>
// --- Constructor ---
ExitSpace::ExitSpace()
{
walkable = true;
defaultSymbol = EXIT;
symbol = defaultSymbol;
}
// --- Destructor ---
ExitSpace::~ExitSpace()
{
}
// --- arrive ---
// Executes upon player arriving in a space;
// does nothing for an empty space
void ExitSpace::arrive(Player* player)
{
std::cout << "You reached the exit!\n";
player->setState(Player::WIN);
}
// --- inspect ---
// Executes upon player choosing to inspect current space
void ExitSpace::inspect(Player* player)
{
}