Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Finds the ship with a right name and removes it from ships_ vector
- void Galaxy::removeShip(std::shared_ptr<Common::Ship> ship){
- if (!ships_.empty()){
- for (auto &i : ships_){
- std::shared_ptr<Common::Ship> temp = ships_[i];
- if ( temp->getName() == ship->getName())
- {
- ships_.erase(i);
- return;
- }
- }
- }
- throw( Common::StateException("Ship does not exist. Can not be removed."));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement