Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Character.h>
- Character* Character::uniqueInstance = NULL;
- Character* Character::Instance(){
- if(Character::uniqueInstance == NULL){
- uniqueInstance = new Character();
- }
- return uniqueInstance;
- }
- Character::Character(){
- stats = new Attributes();
- }
- Character::~Character(){
- delete Character::uniqueInstance;
- Character::uniqueInstance = NULL;
- }
- void Character::showAttributes(){
- cout<<"Name: "<<stats->name<<endl;
- cout<<"Gender: Man"<<endl;
- cout<<"Strength: "<<stats->Strength<<endl;
- cout<<"Dexterity: "<<stats->Dexterity<<endl;
- cout<<"Intelligence: "<<stats->Intelligence<<endl;
- cout<<"Wisdom: "<<stats->Wisdom<<endl;
- }
- void Character::rename(string name){
- stats->name=name;
- }
Add Comment
Please, Sign In to add comment