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

◆ GetValidRecipesProper()

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

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

113 {
114 if (ids) ids.Clear();
115 GetRecipeIntersection(num_of_items,items);
116 int numOfRecipes = SortIngredients(num_of_items,items,m_ResolvedRecipes);
117 //will return number of cached recipes for the 2 items being considered,
118 //and save their indexes in m_ResolvedRecipes, please note the m_ResolvedRecipes is a static array,
119 //and does not clear up with each query, so the number of recipes returned is critical to make sure we don't accidentally
120 //mix in some other indexes from previous queries(and obviously loop only as far as we have to)
121 //this also saves the ingredients in the correct assignment as ingredient 1/2 into m_ingredient1/m_ingredient2 arrays, these 3 arrays
122 //therefore provide you with information per each index with: recipeid,ingredient1,ingredient2
123 if ( numOfRecipes == 0 ) return 0;
124 int found = 0;
125 RecipeBase p_recipe = NULL;
126 for (int i = 0; i < numOfRecipes; i++)
127 {
128 p_recipe = m_RecipeList[m_ResolvedRecipes[i]];
129
130 if ( p_recipe.CheckRecipe(m_ingredient1[i],m_ingredient2[i], player) == true )
131 {
132 if (ids) ids.Insert( p_recipe.GetID() );
133 found++;
134 }
135 }
136 return found;
137 }
void RecipeBase()
Определения RecipeBase.c:67
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:590
ItemBase m_ingredient2[MAX_CONCURENT_RECIPES]
Определения PluginRecipesManager.c:34
int SortIngredients(int num_of_ingredients, ItemBase items_unsorted[], int resolved_recipes[])
Определения PluginRecipesManager.c:640

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

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