I'm really having trouble finding a code to compile my program but here it goes.
All i need is to create a "read" function to read all the data for a Player Object.
So Far i made a display function to display all the data for the "Player" object, but i don't know how to make a read function.
void displayPlayer(const vector<Player>& ePlayer);
void readPlayer(const vector<Player>&ePlayer, string pName, int ptype, int plevel, int pstrength, int wtype, int wdurability, int wlevRequired);
// main function ***********************************************************
int main()
{
vector <Player> gamePlayers;
string playerName;
int playerType, playerLevel, playerStregth, weaponType, weaponDurability, weaponlvlRequired;
// End of program statements
cout << "Please press enter once or twice to continue...";
cin.ignore().get(); // hold console window open
return EXIT_SUCCESS; // successful termination
}
void readPlayer(vector<Player> ePlayer,string pName, int ptype, int plevel, int pstrength, int wtype, int wdurability, int wlevRequired)
{
for (int i = 0; i < 3; ++i)
{
cout << "Enter player name: ";
cin >> pName;
cout << "Enter player type (1, 2, 3, 4): ";
ptype = readValidInteger(1, 4);
cout << "Enter player level (>=1 && <= 100):";
plevel = readValidInteger(1, 100);
cout << "Enter player strength (>= 25):";
pstrength = readValidInteger(25, 200);
cout << "Enter weapon type (1, 2, 3, 4): ";
wtype = readValidInteger(1, 4);
cout << "Enter weapon durability (>= 25):";
wdurability = readValidInteger(25, 200);
cout << "Enter weapon level required (>=1 && <=100): ";
wlevRequired = readValidInteger(1, 100);