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

Item location container #38650

Merged
merged 1 commit into from
Apr 18, 2020

Conversation

KorGgenT
Copy link
Member

@KorGgenT KorGgenT commented Mar 8, 2020

Summary

SUMMARY: Infrastructure "Create item_location::item_in_container"

Purpose of change

item_location is a class we use that has an item pointer and a reference to where that item lives. additionally, the inventory UI code uses item locations in order for the player to interact with items properly. The invntory code hasn't before needed to interact with items directly inside of containers except in special cases scattered around the code, so this implements that. It also implements item_location::parent_item() which returns the parent of the item_location (nowhere and a debugmsg if it has no parent) to aid with some things that need to know what item the item is inside of. I have written some tests for the item_location because the PR does not make use of the new item_location just yet. Additionally, there is some code that is temporary due to pockets needing to be implemented at the same time as it, marked as a comment.

Testing

see item_location_test.cpp

Additional context

NOTE: contains the commits in both #37816 and #38026

@KorGgenT KorGgenT added Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` labels Mar 8, 2020
@KorGgenT KorGgenT added this to the 0.F milestone Mar 8, 2020
@KorGgenT KorGgenT force-pushed the item_location-container branch from 15203da to 6b40fb4 Compare March 8, 2020 20:20
Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things I noticed, by no means a complete review

src/item_location.h Outdated Show resolved Hide resolved
src/item_location.cpp Outdated Show resolved Hide resolved
src/item_location.h Outdated Show resolved Hide resolved
src/item_location.cpp Outdated Show resolved Hide resolved
@KorGgenT KorGgenT force-pushed the item_location-container branch from bb4053e to 25450db Compare March 15, 2020 05:32
@KorGgenT KorGgenT force-pushed the item_location-container branch 5 times, most recently from 4c2e1c4 to 4c54689 Compare April 11, 2020 09:24
@KorGgenT KorGgenT force-pushed the item_location-container branch from 4c54689 to 4960ac2 Compare April 14, 2020 14:05
@KorGgenT KorGgenT force-pushed the item_location-container branch from 4960ac2 to 3d1b43f Compare April 16, 2020 00:39
@kevingranade kevingranade merged commit 1cfe8ce into CleverRaven:master Apr 18, 2020
@KorGgenT KorGgenT deleted the item_location-container branch August 13, 2020 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants