GEP-Assignment1/RankManager.cpp
Player * RankManager::getOrUpdateScoreFromFile(Player *player, std::string filename) {

	ifstream stream(filename);

	std::string contents, line("\n");
	string name, password;
	//int score, firstDelim, secondDelim, temp;
	//Player * newPlayer = new Player;
	//newPlayer->setUserName(player->getUserName());
	while (std::getline(stream, line))
	{
		if (line.size() > 0) {
			//RankManager::createPlayerFromScoreFile(line, newPlayer);
			RankManager::createPlayerFromScoreFile(line, player);
		}
	}
	stream.close();
	//cout <<endl << newPlayer->toString()<< endl;
	//return newPlayer;
	return player;
}
/* Reads a player score details from a score file (filename) and updates the player score info into the player that is passed in. */
Reads a player score details from a score file (filename) and updates the player score info into the player that is passed in.
Reads a player score details from a score file ( filename ) and updates the player score info into the player that is passed in .
Player * RankManager::getOrUpdateScoreFromFile(Player *player, std::string filename) {
	ifstream stream(filename);
	std::string contents, line("\n");
	string name, password;
	while (std::getline(stream, line))
	{
		if (line.size() > 0) {
			RankManager::createPlayerFromScoreFile(line, player);
		}
	}
	stream.close();
	return player;
}
Player * RankManager :: getOrUpdateScoreFromFile ( Player * player , std :: string filename ) { ifstream stream ( filename ) ; std :: string contents , line ( " \n " ) ; string name , password ; while ( std :: getline ( stream , line ) ) { if ( line . size ( ) > 0 ) { RankManager :: createPlayerFromScoreFile ( line , player ) ; } } stream . close ( ) ; return player ; }
Reads a player score details from a score file (filename) and updates the player score info into the player that is passed in.
Reads a player score details from a score file ( filename ) and updates the player score info into the player that is passed in .
//int score, firstDelim, secondDelim, temp; //Player * newPlayer = new Player; //newPlayer->setUserName(player->getUserName()); //RankManager::createPlayerFromScoreFile(line, newPlayer); //cout <<endl << newPlayer->toString()<< endl; //return newPlayer;