-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.cpp
57 lines (52 loc) · 1.62 KB
/
Player.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
49
50
51
52
53
54
55
56
57
//----------------------------------------------------------------------------------------------------------------------
// Player.cpp
//
// This is the imlementation of
// the Player class methods, which
// can be useful later on in the code
// where players start playing.
//
// Authors: 11804229
// 11814996
// 00713374
//----------------------------------------------------------------------------------------------------------------------
//
#include "Player.hpp"
///---------------------------------------------------------------------------------------------------------------------
void Player::popFrontTreasureStack()
{
covered_stack_.pop();
nr_found_treasures_++;
}
///---------------------------------------------------------------------------------------------------------------------
bool Player::stackEmpty()
{
if (covered_stack_.empty() == true)
{
return true;
}
return false;
}
///---------------------------------------------------------------------------------------------------------------------
std::string Player::getCurrentTreasureName()
{
std::string return_string = "";
return_string = covered_stack_.top()->getName();
return return_string;
}
///---------------------------------------------------------------------------------------------------------------------
std::string Player::getCurrentTreasureId()
{
std::stringstream help_id;
std::string id;
if (covered_stack_.top()->getTreasureId() < 10)
{
help_id << 0 << covered_stack_.top()->getTreasureId();
}
else
{
help_id << covered_stack_.top()->getTreasureId();
}
id = help_id.str();
return id;
}