Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick up item #2

Open
dangillet opened this issue May 9, 2012 · 3 comments
Open

Pick up item #2

dangillet opened this issue May 9, 2012 · 3 comments
Assignees
Milestone

Comments

@dangillet
Copy link
Owner

Pick up an item contained in the room or in a container in the room and add it the the inventory.

@LeBoucEtMistere
Copy link
Collaborator

yes it seems to be the logic method

@dangillet
Copy link
Owner Author

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.

@ghost ghost assigned dangillet Jun 2, 2012
@dangillet
Copy link
Owner Author

Implemented. Needs to be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants