Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
PineapplePen/gymmenu.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
96 lines (68 sloc)
1.28 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "gymmenu.h" | |
using namespace std; | |
void Gym::gymmenu() | |
{ | |
Sql sql; | |
PlayerMenu playermenu; | |
int selection; | |
cout << "\n==================="; | |
cout << "\n Welcome to the Gym"; | |
cout << "\n==================="; | |
cout << "\n 1 - WeightLifting"; | |
cout << "\n 2 - Cardio"; | |
cout << "\n Enter selection: "; | |
cin >> selection; | |
if (selection == 1) | |
{ | |
cout << "Press Spacebar 6 Times to Weightlift" << endl; | |
char key = _getch(); | |
int value = key; | |
int counter = 0; | |
while (1) | |
{ | |
key = _getch(); | |
if (key == KEY_SPACE) | |
{ | |
counter++; | |
} | |
if (counter == 4) | |
{ | |
//cout << "UPDATED" << endl; | |
sql.updateStrengthTable(); | |
sql.updateDehydrationTable(); | |
break; | |
} | |
} | |
key = _getch(); | |
value = key; | |
system("cls"); | |
playermenu.ppmenu(); | |
} | |
else if (selection == 2) | |
{ | |
char key = _getch(); | |
int value = key; | |
int counter = 0; | |
while (1) | |
{ | |
key = _getch(); | |
if (key == KEY_SPACE) | |
{ | |
counter++; | |
} | |
if (counter == 4) | |
{ | |
sql.updateDehydrationTable(); | |
sql.updateStaminaTable(); | |
break; | |
} | |
} | |
key = _getch(); | |
value = key; | |
system("cls"); | |
playermenu.ppmenu(); | |
} | |
else { | |
cout << "\n Invalid selection"; | |
} | |
} |