Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool add_player(vector<Player> &player_vector)
- {
- string name;
- string comp_name;
- getline(cin, name);
- system("CLS");
- cout << "Podaj login gracza: ";
- getline(cin, name);
- for (int i = 0; i < player_vector.size(); i++)
- {
- comp_name = player_vector[i].get_name();
- if (name.compare(comp_name) == 0)
- {
- cout << endl;
- cout << "Wybrany login jest zajety.";
- Sleep(2000);
- return flase;
- }
- }
- player_vector.push_back(Player(name));
- cout << "Gracz " << name << " pomyslnie dodany do ligi.";
- Sleep(2000);
- return true;
- }
- int main()
- {
- if(add_player(player_vector))
- {
- //if zawsze wpuszcza do srodka bez roznicy co zwraca add_player()
- }
- }
Add Comment
Please, Sign In to add comment