DayZ 1.24
Loading...
Searching...
No Matches
CacheObject.c File Reference

Go to the source code of this file.

Classes

class  RecipeCacheData
 

Functions

void CacheObject ()
 
bool AddRecipe (int recipe_id, int mask)
 
void UpdateMask (int recipe_id, int mask)
 
int GetNumberOfRecipes ()
 
array< intGetRecipes ()
 
bool IsContainRecipe (int recipe_id)
 
int GetMaskByRecipeID (int recipe_id)
 
int GetBitCountByRecipeID (int recipe_id)
 
void DebugPrint ()
 

Variables

class RecipeCacheData int
 
class RecipeCacheData m_Recipes
 
ref array< intm_RecipeIDs
 

Function Documentation

◆ AddRecipe()

bool AddRecipe ( int recipe_id,
int mask )

Definition at line 41 of file CacheObject.c.

42 {
44 if (data)
46 else
47 {
49 m_RecipeIDs.Insert(recipe_id);
50
51 }
52 return true;
53 }
ref array< int > m_RecipeIDs
Definition CacheObject.c:33
class RecipeCacheData m_Recipes
void UpdateMask(int recipe_id, int mask)
Definition CacheObject.c:56

References m_RecipeIDs, m_Recipes, and UpdateMask().

◆ CacheObject()

◆ DebugPrint()

void DebugPrint ( )

Definition at line 95 of file CacheObject.c.

96 {
97 for (int i = 0; i < m_Recipes.Count(); i++)
98 {
99 Print("recipeID:" + m_Recipes.GetKey(i).ToString());
100 Print("mask:" + m_Recipes.GetElement(i).m_Mask.ToString());
101 Print("m_BitCount:" + m_Recipes.GetElement(i).m_BitCount.ToString());
102
103 }
104 }
proto void Print(void var)
Prints content of variable to console/log.

References m_Recipes, and Print().

◆ GetBitCountByRecipeID()

int GetBitCountByRecipeID ( int recipe_id)

Definition at line 87 of file CacheObject.c.

88 {
90 if (cache_data)
91 return cache_data.GetBitCount();
92 return 0;
93 }

References m_Recipes.

◆ GetMaskByRecipeID()

int GetMaskByRecipeID ( int recipe_id)

Definition at line 79 of file CacheObject.c.

80 {
82 if (cache_data)
83 return cache_data.GetMask();
84 return 0;
85 }

References m_Recipes.

◆ GetNumberOfRecipes()

int GetNumberOfRecipes ( )

Definition at line 64 of file CacheObject.c.

65 {
66 return m_Recipes.Count();
67 }

References m_Recipes.

◆ GetRecipes()

array< int > GetRecipes ( )

Definition at line 69 of file CacheObject.c.

70 {
71 return m_RecipeIDs;
72 }

References m_RecipeIDs.

◆ IsContainRecipe()

bool IsContainRecipe ( int recipe_id)

Definition at line 74 of file CacheObject.c.

75 {
76 return m_Recipes.Contains(recipe_id);
77 }

References m_Recipes.

◆ UpdateMask()

void UpdateMask ( int recipe_id,
int mask )

Definition at line 56 of file CacheObject.c.

57 {
59 data.SetMask(data.GetMask() | mask);
60
61 }

References m_Recipes.

Referenced by AddRecipe().

Variable Documentation

◆ int

◆ m_RecipeIDs

ref array<int> m_RecipeIDs

Definition at line 33 of file CacheObject.c.

Referenced by AddRecipe(), CacheObject(), and GetRecipes().

◆ m_Recipes