#include "src/interface/creation.hpp"
|
|
#include "src/interface/info.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
Player *createCharacter()
|
|
{
|
|
std::string name;
|
|
|
|
char choice;
|
|
|
|
Player *newPlayer = new Player("HackTheGame");
|
|
|
|
std::cout << "Welcome to character creation !!!" << std::endl;
|
|
|
|
do
|
|
{
|
|
std::cout << "Please enter your character name: (Max 15 letters)\n"
|
|
<< "> " << std::flush;
|
|
|
|
std::cin >> name;
|
|
if (name.size() > 15)
|
|
{
|
|
std::cout << "Your name is too long!" << std::endl;
|
|
continue;
|
|
}
|
|
|
|
std::cout << "Creating your character..." << std::endl;
|
|
|
|
delete newPlayer;
|
|
newPlayer = new Player(name);
|
|
|
|
std::cout << "Done...\n"
|
|
<< "Character Info: " << std::endl;
|
|
|
|
Info::ofCharacter(newPlayer);
|
|
|
|
std::cout << "Accept (y/N)?: " << std::flush;
|
|
std::cin >> choice;
|
|
} while (choice != 'Y' && choice != 'y');
|
|
|
|
return newPlayer;
|
|
}
|