You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, I changed my mind concerning the smart pointers. I'm using shared_ptr instead of unique_ptr. Though the initial idea was right (an object belongs to only one place), a pointer is still needed when we want to access it. So we end up with a copy => not possible with a unique_ptr.
I know that it's possible to return a const unique_ptr&, but in my function GetObjectByName, I have to be able to return a null pointer in case the object is not found. Now another alternative would be for that function to throw if the object is not found.
Pick up an item contained in the room or in a container in the room and add it the the inventory.
The text was updated successfully, but these errors were encountered: