MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / recipesFromSubset

Method recipesFromSubset

source/game/StarItemDatabase.cpp:88–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88HashSet<ItemRecipe> ItemDatabase::recipesFromSubset(HashMap<ItemDescriptor, uint64_t> const& normalizedBag, StringMap<uint64_t> const& availableCurrencies, HashSet<ItemRecipe> const& subset) {
89 HashSet<ItemRecipe> res;
90 for (auto const& recipe : subset) {
91 // add this recipe if we can make it.
92 if (canMakeRecipe(recipe, normalizedBag, availableCurrencies))
93 res.add(recipe);
94 }
95
96 return res;
97}
98
99HashSet<ItemRecipe> ItemDatabase::recipesFromSubset(HashMap<ItemDescriptor, uint64_t> const& normalizedBag, StringMap<uint64_t> const& availableCurrencies,
100 HashSet<ItemRecipe> const& subset, StringSet const& allowedTypes) {

Callers 1

determineRecipesMethod · 0.80

Calls 3

hasIntersectionMethod · 0.80
addMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected