DayZ 1.30
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 строка 496

497 {
498 ClearResults();
499
500 for (int i = 0; i < num_of_ingredients; i++)
501 {
502 CacheObject co_item = PluginRecipesManager.m_RecipeCache.Get( ingredients_unsorted[i].GetType() );
503 m_IngredientBitMask[i] = co_item.GetMaskByRecipeID(id);
504 m_IngredientBitMaskSize[i] = co_item.GetBitCountByRecipeID(id);
505 }
506
507 bool result = ResolveIngredients(num_of_ingredients);
508
509 if (result)
510 {
511 for (i = 0; i < num_of_ingredients; i++)
512 {
513 int index = Math.Log2( m_BitsResults[i]);
514 ingredients_sorted[index] = ingredients_unsorted[ i ];
515 }
516 }
517 //PrintResultMasks(num_of_ingredients);
518 return result;
519 }
eBleedingSourceType GetType()
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:530
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().