-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresentDay.cpp
113 lines (99 loc) · 3.85 KB
/
presentDay.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/***********************************************************
**CLASS: PRESENTDAY
**
**DESCRIPTION: CPP FILE
**
**A derived class of the Era class. PresentDay has a message
**displaying that the player is in the future and that he
**has won.
***********************************************************/
#include "presentDay.hpp"
/*************************************************************
**Function: The1950s()
**Description: Constructor sets year to "FUTURE"
**Parameters: N/A
**Pre-Conditions: N/A
**Post-Conditions: N/A
*************************************************************/
PresentDay::PresentDay(): Era() {
year = "FUTURE";
}
/*************************************************************
**Function: PresentDay(string, Era *&, Era *&, Era *&, Era *&)
**Description: Constructor uses parameters, sends them
**to set methods.
**Parameters: string (year), Era * & (forward),
**Era * & (backward), Era * & (itself), Era * & (secret)
**Pre-Conditions: N/A
**Post-Conditions: Era's 4 pointers will be assigned to
**point to the Era's passed by reference
*************************************************************/
PresentDay::PresentDay(string year, Era * &forw, Era * &back, Era * &it, Era * &secret): Era(year, forw, back, it, secret)
{
//SETS INHERITED MEMBERS :)
}
/*************************************************************
**Function: ~PresentDay()
**Description: Destructor deletes pointers forward,
**backward, itself and secretPassage
**Parameters: N/A
**Pre-Conditions: N/A
**Post-Conditions: N/A
*************************************************************/
PresentDay::~PresentDay() {
delete forward;
delete backward;
delete itself;
delete secretPassage;
}
/*************************************************************
**Function: message()
**Description: Displays message from the FUTURE. This is
**the goal of the game for the player to end up here. The
**message of this Era congratulates the player.
**Parameters: N/A
**Pre-Conditions: N/A
**Post-Conditions: N/A
*************************************************************/
void PresentDay::message() {
cout << "You are in the decade of the..." << this->year <<endl <<endl;
cout << "Great Scott! You did it!" <<endl <<endl;
cout << "********CONGRATULATIONS MARTY MCFLY!**********" <<endl;
cout << "You travelled through decades in the " <<endl;
cout << "DeLorean, back in time, and got your parents to get together!" <<endl <<endl;
cout << "You are now BACK TO THE FUTURE!" <<endl;
}
/*************************************************************
**Function: lyric()
**Description: Returns true. User does not need to guess
**lyric in this Era since this is end of the game.
**Parameters: N/A
**Pre-Conditions: N/A
**Post-Conditions: N/A
*************************************************************/
bool PresentDay::lyric() {
bool guessedCorrect = true;
return guessedCorrect;
}
/*************************************************************
**Function: collect()
**Description: Returns " ". User does not need to collect
**item in this Era since this is the end of the game.
**Parameters: N/A
**Pre-Conditions: N/A
**Post-Conditions: N/A
*************************************************************/
string PresentDay::collect() {
string item = " ";
return item;
}
/*************************************************************
**Function: song()
**Description: No song to display since this is the end
**of the game.
**Parameters: N/A
**Pre-Conditions: N/A
**Post-Conditions: N/A
*************************************************************/
void PresentDay::song(){
}