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

◆ SortIngredientsInRecipe()

bool PluginRecipesManagerBase::SortIngredientsInRecipe ( int id,
int num_of_ingredients,
ItemBase ingredients_unsorted[],
ItemBase ingredients_sorted[] )
inlineprotected

sorts ingredients correctly as either first or second ingredient based on their masks

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

490 {
491 ClearResults();
492
493 for (int i = 0; i < num_of_ingredients; i++)
494 {
495 CacheObject co_item = PluginRecipesManager.m_RecipeCache.Get( ingredients_unsorted[i].GetType() );
496 m_IngredientBitMask[i] = co_item.GetMaskByRecipeID(id);
497 m_IngredientBitMaskSize[i] = co_item.GetBitCountByRecipeID(id);
498 }
499
500 bool result = ResolveIngredients(num_of_ingredients);
501
502 if (result)
503 {
504 for (i = 0; i < num_of_ingredients; i++)
505 {
506 int index = Math.Log2( m_BitsResults[i]);
507 ingredients_sorted[index] = ingredients_unsorted[ i ];
508 }
509 }
510 //PrintResultMasks(num_of_ingredients);
511 return result;
512 }
eBleedingSourceType GetType()
Определения BleedingSource.c:63
void CacheObject()
Определения CacheObject.c:35
void PluginRecipesManager()
Определения PluginRecipesManager.c:52
int m_IngredientBitMaskSize[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:29
bool ResolveIngredients(int num_of_ingredients, int passes=0)
Определения PluginRecipesManager.c:523
int m_BitsResults[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:31
int m_IngredientBitMask[MAX_INGREDIENTS]
Определения PluginRecipesManager.c:28

Перекрестные ссылки CacheObject(), ClearResults(), GetType(), Math::Log2(), m_BitsResults, m_IngredientBitMask, m_IngredientBitMaskSize, PluginRecipesManager() и ResolveIngredients().

Используется в GetSoundCategory(), IsRecipePossibleToPerform(), PerformRecipeServer() и SortIngredients().