-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroom3.cpp
103 lines (89 loc) · 2.51 KB
/
room3.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
/***************************************************************************
** Author: Sunghoon Cho
** Date: 12/4/18
** Program name: Room3 class implementation file
****************************************************************************/
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include "room3.hpp"
#include "inputValidation.hpp"
using std::cin;
using std::cout;
using std::endl;
//************************************************************************
// Room3 Constructor
//************************************************************************
Room3::Room3()
{
name = "Room 3";
}
//************************************************************************
// swipe lets the player swipe to choose or go in blind into the date
// is overridden due to the photo or secret skill add
//************************************************************************
bool Room3::swipe(Player &user)
{
//Room3 is another hidden place where intereaction adds random skills
randomSkillAdd(user);
cout << "\nYou can choose to see their picture first or go straight into a blind date." << endl;
cout << "\nPress 1 to see their picture first" << endl;
cout << "Press 2 to go in blind" << endl;
bool interact = false;
bool valid = false;
int swipeOrNot;
//input validation
do{
swipeOrNot = intChosen(1,2);
if(swipeOrNot <= 0 || swipeOrNot > 2)
{
valid = false;
std::cout << "Please enter a valid number" << std::endl;
}
else
{
valid = true;
}
}while(!valid);
if(swipeOrNot == 1) //go in with a swipe, maybe exit based on what you see
{
cout << "____Photo____" << endl;
cout << "\n(⊙_⊙')" << endl;
cout << "\nEnter the room?" << endl;
cout << "Press 1 for YES, 2 for NO" << endl;
bool valid = false;
int swipe;
//input validation
do{
swipe = intChosen(1,2);
if(swipe <= 0 || swipe > 2)
{
valid = false;
std::cout << "Please enter a valid number" << std::endl;
}
else
{
valid = true;
}
}while(!valid);
if(swipe == 1)
{
didYouSwipe = true;
swipeYes = true;
interact = true;
}
else if(swipe == 2)
{
didYouSwipe = true;
swipeYes = false;
interact = false;
}
}
else if(swipeOrNot == 2) //go in blind
{
interact = true;
}
user.reduceMovementCount();
return interact;
}