-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: stack comestibles regardless of rot (#4320)
* feat: stack comestibles regardless of rot * feat: configurable merge strategy * perf: cache option * fix: take account of liquid only option * feat: display item content freshness * fix: averaged rot in liquid transfer * test: test legacy and all merging * fix: fallthrough in switch statement * fix: explicit fallthrough * feat: change to similarity based merging
- Loading branch information
Showing
5 changed files
with
225 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "cached_item_options.h" | ||
|
||
merge_comestible_t merge_comestible_mode = merge_comestible_t::merge_legacy; | ||
|
||
float similarity_threshold; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
#ifndef CATA_SRC_CACHED_ITEM_OPTIONS_H | ||
#define CATA_SRC_CACHED_ITEM_OPTIONS_H | ||
|
||
enum class merge_comestible_t { | ||
merge_legacy, | ||
merge_liquid, | ||
merge_all, | ||
}; | ||
|
||
/** | ||
* Merge similar comestibles. Legacy: default behavior. Liquid: Merge only liquid comestibles. All: Merge all comestibles. | ||
*/ | ||
extern merge_comestible_t merge_comestible_mode; | ||
|
||
/** | ||
* Limit maximum allowed staleness difference when merging comestibles. | ||
* The lower the value, the more similar the items must be to merge. | ||
* 0.0: Only merge identical items. | ||
* 1.0: Merge comestibles regardless of its freshness. | ||
*/ | ||
extern float similarity_threshold; | ||
|
||
#endif // CATA_SRC_CACHED_ITEM_OPTIONS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters