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

Add item::get_food #36119

Merged
merged 2 commits into from
Dec 16, 2019
Merged

Add item::get_food #36119

merged 2 commits into from
Dec 16, 2019

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: None

Purpose of change

There were many places in the codebase which had to fetch either an item or its contents, depending on which was food. This led to code duplication and distraction from the main intent of the code.

Describe the solution

Factor that logic out into a new item member function, to simplify code elsewhere.

Testing

Unit tests.

Additional context

A side-project during my work on #28180, where I also found myself needing this functionality.

src/item.cpp Outdated Show resolved Hide resolved
There were many places in the codebase which had to fetch either an item
or its contents, depending on which was food.  Factor that logic out
into a new item member function, to simplify code elsewhere.
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Items: Food / Vitamins Comestibles and drinks labels Dec 16, 2019
@ZhilkinSerg ZhilkinSerg merged commit b58d83c into CleverRaven:master Dec 16, 2019
@jbytheway jbytheway deleted the item_get_food branch December 17, 2019 00:04
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: Infrastructure / Style / Static Analysis Code internal infrastructure and style Items: Food / Vitamins Comestibles and drinks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants