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?
Old-School-Game/user.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38 lines (31 sloc)
971 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
#include <vector> | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
/*User class is a class that represents the player and will contain info | |
marking progress, name and current settings for the game. | |
*/ | |
class user{ | |
private: | |
char* name; | |
char* lang; | |
char* term; | |
float timeplayed; | |
float money; | |
public: | |
//Creates user, can be used to check if user was previously created. | |
user(){ | |
const char* name = std::getenv("USER"); | |
const char* lang = std::getenv("LANGUAGE"); | |
const char* term = std::getenv("TERM"); | |
float timeplayed = 0.0 ; | |
float money = 0.0; | |
}; | |
~user(){ | |
std::cout << "User object has been destroyed" << std::endl ; | |
} | |
char* getName() {return name;} | |
char* getLang() {return lang;} | |
char* getTerm() {return term;} | |
float gettimePlayed() {return timeplayed;} | |
}; | |