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?
Bazoonkas_Tamagotchi/movingText.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
59 lines (48 sloc)
1.09 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 <iostream> | |
#include <vector> | |
#include <string> | |
#include "display.h" | |
#include "Stats.h" | |
using namespace std; | |
string output; | |
//This code shouldn't be used in end product, just used to show how you can incorporated display.h and Stats.h | |
//into the main body of code | |
int main() | |
{ | |
Stats firstPet("Buddy"); | |
firstPet.inc_Hunger(-51, true); | |
firstPet.inc_Happiness(-60, false); | |
firstPet.inc_Health(-70, true); | |
Stats secondPet("Garfield"); | |
vector<string> options = {"Food", "Shop", "Games", "Save", "Exit"}; | |
string output = Display(options); | |
cout << "\n" << endl; | |
if(output == "Food") | |
{ | |
cout << "I'm hungry!" << endl; | |
firstPet.inc_Hunger(10, false); | |
} | |
else if(output == "Shop") | |
{ | |
cout << "We're closed at the moment!!" << endl; | |
} | |
else if(output == "Games") | |
{ | |
cout << "Let's go play football!" << endl; | |
} | |
else if(output == "Save") | |
{ | |
firstPet.Save(); | |
secondPet.Save(); | |
firstPet.getSave(); | |
secondPet.getSave(); | |
} | |
else if(output == "Exit") | |
{ | |
cout << "Bye!!" << endl; | |
} | |
else | |
cout << "unable to distinguish what you've said!" << endl; | |
cout << "\n" << endl; | |
return 0; | |
} |