DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetValidRecipesProper()

int PluginRecipesManagerBase::GetValidRecipesProper ( int num_of_items,
ItemBase items[],
array< int > ids,
PlayerBase player )
inlineprivate

См. определение в файле PluginRecipesManager.c строка 105

106 {
107 if (ids) ids.Clear();
108 GetRecipeIntersection(num_of_items,items);
109 int numOfRecipes = SortIngredients(num_of_items,items,m_ResolvedRecipes);
110 //will return number of cached recipes for the 2 items being considered,
111 //and save their indexes in m_ResolvedRecipes, please note the m_ResolvedRecipes is a static array,
112 //and does not clear up with each query, so the number of recipes returned is critical to make sure we don't accidentally
113 //mix in some other indexes from previous queries(and obviously loop only as far as we have to)
114 //this also saves the ingredients in the correct assignment as ingredient 1/2 into m_ingredient1/m_ingredient2 arrays, these 3 arrays
115 //therefore provide you with information per each index with: recipeid,ingredient1,ingredient2
116 if ( numOfRecipes == 0 ) return 0;
117 int found = 0;
118 RecipeBase p_recipe = NULL;
119 for (int i = 0; i < numOfRecipes; i++)
120 {
121 p_recipe = m_RecipeList[m_ResolvedRecipes[i]];
122
123 if ( p_recipe.CheckRecipe(m_ingredient1[i],m_ingredient2[i], player) == true )
124 {
125 if (ids) ids.Insert( p_recipe.GetID() );
126 found++;
127 }
128 }
129 return found;
130 }
ItemBase m_ingredient1[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:33
ref array< ref RecipeBase > m_RecipeList
Определения PluginRecipesManager.c:42
int m_ResolvedRecipes[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:24
int GetRecipeIntersection(int num_of_ingredients, ItemBase items[])
fills an array with recipe IDs which 'item_a' and 'item_b' share
Определения PluginRecipesManager.c:583
ItemBase m_ingredient2[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:34
int SortIngredients(int num_of_ingredients, ItemBase items_unsorted[], int resolved_recipes[])
Определения PluginRecipesManager.c:633
int GetID()
Определения RecipeBase.c:554
bool CheckRecipe(ItemBase item1, ItemBase item2, PlayerBase player)
Определения RecipeBase.c:455

Перекрестные ссылки RecipeBase::CheckRecipe(), RecipeBase::GetID(), GetRecipeIntersection(), m_ingredient1, m_ingredient2, m_RecipeList, m_ResolvedRecipes и SortIngredients().

Используется в GetValidRecipes().