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/AnimalStates.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
95 lines (85 sloc)
1.67 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 <string> | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
class Animals | |
{ | |
public: | |
std::string hungry; | |
std::string tired; | |
std::string happy; | |
std::string name; | |
Animals( std::string _name, std::string _hungry, std::string _tired, std::string _happy ) : name(_name), hungry(_hungry), tired(_tired), happy(_happy) {} | |
void normal() const | |
{ | |
cout << "ASCII" << endl; | |
} | |
void play() const | |
{ | |
cout << "ASCII" << endl; | |
} | |
void relax() const | |
{ | |
cout << "ASCII" << endl; | |
} | |
}; | |
class Cat : public Animals | |
{ | |
public: | |
Cat(std::string _name) : Animals(_name, "meoowwww, I'm starving", "I think its sleepy cat time....", "This is purrrrrfect!") {} | |
void normal () const | |
{ | |
system("cls"); | |
ifstream f("normalCat.txt"); | |
if (f.is_open()) | |
cout << f.rdbuf(); | |
} | |
void play() const | |
{ | |
system("cls"); | |
ifstream f("playCat.txt"); | |
if (f.is_open()) | |
cout << f.rdbuf(); | |
} | |
void relax() const | |
{ | |
system("cls"); | |
ifstream f("relaxedCat.txt"); | |
if (f.is_open()) | |
cout << f.rdbuf(); | |
} | |
std::string getHappy() | |
{ | |
return happy; | |
} | |
}; | |
class Dog : public Animals | |
{ | |
public: | |
Dog(std::string _name) : Animals(_name, "is it dinner time??", "rweeeeeepyy", "WUF, wuf, Wonderful!!") {} | |
void normal () const | |
{ | |
system("cls"); | |
ifstream f("normalDog.txt"); | |
if (f.is_open()) | |
cout << f.rdbuf(); | |
} | |
void play() const | |
{ | |
system("cls"); | |
ifstream f("playDog.txt"); | |
if (f.is_open()) | |
cout << f.rdbuf(); | |
} | |
void relax() const | |
{ | |
system("cls"); | |
ifstream f("relaxedDog.txt"); | |
if (f.is_open()) | |
cout << f.rdbuf(); | |
} | |
std::string getHappy() | |
{ | |
return happy; | |
} | |
}; | |