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

◆ CheckIngredientMatch()

bool RecipeBase::CheckIngredientMatch ( ItemBase item1,
ItemBase item2 )
inlineprotected

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

100 {
101 if (item1 == NULL || item2 == NULL) return false;
102
103 m_Items[0] = item1;
104 m_Items[1] = item2;
105
106 bool found = false;
107 for (int i = 0; i < MAX_NUMBER_OF_INGREDIENTS; i++)//all ingredients
108 {
109 found = false;
110 array<string> tempArray = m_Ingredients[i];
111 for (int x = 0; x < tempArray.Count(); x++)//particular ingredient array
112 {
113 for (int z = 0; z < MAX_NUMBER_OF_INGREDIENTS; z++)
114 {
115 if (m_Items[z] != NULL)
116 {
117 ItemBase item = m_Items[z];
118 if (tempArray.Get(x) == item.GetType() || GetGame().IsKindOf(item.GetType(),tempArray.Get(x)))
119 {
120 found = true;//we found a match
121 //m_IngredientsSorted.Insert(item);
122 m_IngredientsSorted[i] = item;
123 m_Items[z] = NULL;
124 }
125 }
126 if (found) break;//we found a match, no need to check the remaining ingredients
127 }
128 if (found) break;//we found a match, no need to check this m_Ingredient array
129 }
130 if (!found) return false;// no match within an m_Ingredient array, no reason to continue the search, recipe is invalid
131 }
132
133 if (found)
134 {
135 return true;
136 }
137 else
138 {
139 return false;
140 }
141 }
class GP5GasMask extends MaskBase ItemBase
Icon x
const int MAX_NUMBER_OF_INGREDIENTS
Определения RecipeBase.c:1
ref array< string > m_Ingredients[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:8
ItemBase m_Items[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:12
ItemBase m_IngredientsSorted[MAX_NUMBER_OF_INGREDIENTS]
Определения RecipeBase.c:14
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_Ingredients, m_IngredientsSorted, m_Items, MAX_NUMBER_OF_INGREDIENTS и x.