DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CacheObject.c
См. документацию.
1
3{
4 int m_Mask;
6
7 void RecipeCacheData(int mask)
8 {
9 SetMask(mask);
10 }
11
12 int GetMask()
13 {
14 return m_Mask;
15 }
16
18 {
19 return m_BitCount;
20 }
21
22 void SetMask(int mask)
23 {
24 m_Mask = mask;
26 }
27
28}
29
30class CacheObject
31{
34 //RecipeCacheData data;
40
41 bool AddRecipe(int recipe_id, int mask)
42 {
43 RecipeCacheData data = m_Recipes.Get(recipe_id);
44 if(data)
45 {
46 UpdateMask(recipe_id, mask);
47 }
48 else
49 {
50 m_Recipes.Insert(recipe_id, new RecipeCacheData(mask));
51 m_RecipeIDs.Insert(recipe_id);
52
53 }
54 return true;
55 }
56
57
58 void UpdateMask(int recipe_id, int mask)
59 {
60 RecipeCacheData data = m_Recipes.Get(recipe_id);
61 data.SetMask(data.GetMask() | mask);
62
63 }
64
65
67 {
68 return m_Recipes.Count();
69 }
70
72 {
73 return m_RecipeIDs;
74 }
75
76 bool IsContainRecipe(int recipe_id)
77 {
78 return m_Recipes.Contains(recipe_id);
79 }
80
81 int GetMaskByRecipeID(int recipe_id)
82 {
83 RecipeCacheData cache_data = m_Recipes.Get(recipe_id);
84 if(cache_data)
85 return cache_data.GetMask();
86 return 0;
87 }
88
89 int GetBitCountByRecipeID(int recipe_id)
90 {
91 RecipeCacheData cache_data = m_Recipes.Get(recipe_id);
92 if(cache_data)
93 return cache_data.GetBitCount();
94 return 0;
95 }
96
98 {
99 for(int i = 0; i < m_Recipes.Count();i++)
100 {
101 Print("recipeID:"+m_Recipes.GetKey(i).ToString());
102 Print("mask:"+m_Recipes.GetElement(i).m_Mask.ToString());
103 Print("m_BitCount:"+m_Recipes.GetElement(i).m_BitCount.ToString());
104
105 }
106 }
107}
bool IsContainRecipe(int recipe_id)
Определения CacheObject.c:76
array< int > GetRecipes()
Определения CacheObject.c:71
ref array< int > m_RecipeIDs
Определения CacheObject.c:33
int GetBitCountByRecipeID(int recipe_id)
Определения CacheObject.c:89
int GetNumberOfRecipes()
Определения CacheObject.c:66
class RecipeCacheData m_Recipes
int GetMaskByRecipeID(int recipe_id)
Определения CacheObject.c:81
void DebugPrint()
Определения CacheObject.c:97
void CacheObject()
Определения CacheObject.c:35
void UpdateMask(int recipe_id, int mask)
Определения CacheObject.c:58
bool AddRecipe(int recipe_id, int mask)
Определения CacheObject.c:41
map
Определения ControlsXboxNew.c:4
Определения EnMath.c:7
void SetMask(int mask)
Определения CacheObject.c:22
void RecipeCacheData(int mask)
Определения CacheObject.c:7
int GetMask()
Определения CacheObject.c:12
int GetBitCount()
Определения CacheObject.c:17
int m_Mask
Определения CacheObject.c:4
int m_BitCount
Определения CacheObject.c:5
Определения CacheObject.c:3
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto void Print(void var)
Prints content of variable to console/log.
static proto int GetNumberOfSetBits(int i)
returns the number of bits set in a bitmask i