Example #1
0
void Feed::setFood(std::string setFood, Cat &cat, Shop &shop)
{
	if(feedBag.size() != 0)
	{
		shop.printVector(feedBag);

		if(setFood.compare("cheap eats") == 0)
		{
			cat.setHunger(cat.getHunger() + 2);
			//reduce use by one
			withoutFood = 0;
		}
		if(setFood.compare("normans normal chow") == 0)
		{
			cat.setHunger(cat.getHunger() + 3);
			//reduce use by one
			withoutFood = 0;
		}
		if(setFood.compare("feline fancy") == 0)
		{
			cat.setHunger(cat.getHunger() + 4);
			//reduce use by one
			withoutFood = 0;
		}
	}
	else
		std::cout << "Get your cat some food!" << std::endl;
}
Example #2
0
void Feed::catEat(User &user, Cat &cat)
{
	if(user.phrase.compare("feed") == 0 && cat.getHunger() < 30)
	{
		std::cout << "select your cat's meal" << std::endl;
		setFood(/*cat string*/);
		std::cout << std::endl;
		std::getline(std::cin, user.phrase)
	}