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?
FarmingGame/maingame.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (40 sloc)
972 Bytes
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
#ifndef MAINGAME_H | |
#define MAINGAME_H | |
#include <iostream> | |
#include "shop.h" | |
#include "dig.h" | |
#include "menu2.h" | |
#include "shop.cpp" | |
#include "shopsell.h" | |
#include "lower.h" | |
int main_game() | |
{ | |
std::cout << "Would you like to shop or farm (farm/shop).\n "; //need the user to input farm or shop | |
std::string Answer; | |
std::cin >> Answer; | |
Answer = convertToLowercase(string(Answer)); //convert stuff to lowercase | |
if (Answer == "farm") | |
{ | |
farm digg; | |
string question; | |
digg.dig(question); | |
} | |
if (Answer == "shop") | |
{ | |
std::cout << "Would you like to buy or sell?" << std::endl; | |
std::cin >> Answer; | |
convertToLowercase(string(Answer)); | |
if (Answer == "buy") | |
{ | |
Shop harvestaShop; //creates object of the shop class names 'harvestaShop' | |
harvestaShop.beginshopping(); //calls beginshopping function | |
} | |
if (Answer == "sell") | |
{ | |
Shop_Sell shop; | |
shop.begin_sell(); | |
} | |
} | |
return 0; | |
} | |
#endif |