Advertisement
Guest User

Untitled

a guest
May 6th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. void Player::setCommand(std::vector<std::string> &new_command)
  2. {
  3. std::string input = "";
  4. std::string argument = "";
  5. new_command.clear();
  6. command_.clear();
  7.  
  8. while (command_.size() == 0)
  9. {
  10. std::cout << "sep> ";
  11.  
  12. getline(std::cin, input);
  13. std::istringstream input_string(input);
  14.  
  15. while (input_string >> argument)
  16. {
  17. command_.push_back(argument);
  18. }
  19. }
  20. std::transform(command_[0].begin(), command_[0].end(), command_[0].begin(), tolower);
  21. new_command = command_;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement