Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
PluginRecipesManagerBase Class Reference

Protected Member Functions

bool CheckRecipe (int id, ItemBase item1, ItemBase item2, PlayerBase player)
void ClearResults ()
void CreateAllRecipes ()
void GenerateHumanReadableRecipeList ()
void GenerateRecipeCache ()
int GetAnimationCommandUID (int recipeID)
RecipeAnimationInfo GetRecipeAnimationInfo (int recipeID, PlayerBase player, ItemBase mainItem, ItemBase target)
int GetRecipeIntersection (int num_of_ingredients, ItemBase items[])
 fills an array with recipe IDs which 'item_a' and 'item_b' share
array< RecipeBaseGetRecipesForItem (string itemName)
string GetSoundCategory (int recipeID, ItemBase item1, ItemBase item2)
bool IsRecipePossibleToPerform (int id, ItemBase itemA, ItemBase itemB, PlayerBase player)
void MatchItems (TStringArray full_path)
void PerformRecipeServer (int id, ItemBase item_a, ItemBase item_b, PlayerBase player)
void PrintCache ()
void PrintResultMasks (int num)
bool RecipeSanityCheck (int num_of_ingredients, InventoryItemBase items[], PlayerBase player)
void RegisterRecipe (RecipeBase recipe)
bool ResolveIngredients (int num_of_ingredients, int passes=0)
int SortIngredients (int num_of_ingredients, ItemBase items_unsorted[], int resolved_recipes[])
bool SortIngredientsInRecipe (int id, int num_of_ingredients, ItemBase ingredients_unsorted[], ItemBase ingredients_sorted[])
 sorts ingredients correctly as either first or second ingredient based on their masks
void UnregisterRecipe (string clasname)
void WalkRecipes ()

Static Protected Member Functions

static int RecipeIDFromClassname (string classname)

Protected Attributes

int item_mask
int m_BaseMask
string m_BaseName
ref CacheObject m_CoBase
ref CacheObject m_CoItem
string m_ItemName
ref array< intm_RcpsArray
int m_RecipeID

Private Member Functions

void ~PluginRecipesManager ()
void CallbackGenerateCache ()
bool GetIsInstaRecipe (int recipe_id)
bool GetIsRepeatable (int recipe_id)
float GetRecipeLengthInSecs (int recipe_id)
string GetRecipeName (int recipe_id)
float GetRecipeSpecialty (int recipe_id)
int GetValidRecipes (ItemBase item1, ItemBase item2, array< int > ids, PlayerBase player)
int GetValidRecipesProper (int num_of_items, ItemBase items[], array< int > ids, PlayerBase player)
bool IsEnableDebugCrafting ()
override void OnInit ()
void PluginRecipesManager ()
void SetEnableDebugCrafting (bool enable)

Static Private Member Functions

static int GetMaxNumberOfRecipes ()

Private Attributes

int m_BitsResults [MAX_INGREDIENTS]
ref array< stringm_CachedItems = new array<string>
bool m_EnableDebugCrafting = false
ItemBase m_ingredient1 [MAX_CONCURENT_RECIPES]
ItemBase m_ingredient2 [MAX_CONCURENT_RECIPES]
ItemBase m_ingredient3 [MAX_CONCURENT_RECIPES]
int m_IngredientBitMask [MAX_INGREDIENTS]
int m_IngredientBitMaskSize [MAX_INGREDIENTS]
ItemBase m_Ingredients [MAX_INGREDIENTS]
ref array< ref RecipeBasem_RecipeList = new array<ref RecipeBase>
ref array< intm_RecipesMatched = new array<int>
int m_RegRecipeIndex
int m_ResolvedRecipes [MAX_CONCURENT_RECIPES]
ItemBase m_sortedIngredients [MAX_NUMBER_OF_INGREDIENTS]
ref Timer m_TestTimer
const int MAX_CONCURENT_RECIPES = 128
const int MAX_INGREDIENTS = 5
const int MAX_NUMBER_OF_RECIPES = GetMaxNumberOfRecipes()
ref Timer myTimer1

Static Private Attributes

static ref map< string, ref CacheObjectm_RecipeCache = new map<string,ref CacheObject >
static ref map< string, intm_RecipeNamesList = new map<string, int>
static ref map< typename, boolm_RecipesInitializedItem = new map<typename, bool>

Detailed Description

Definition at line 12 of file pluginrecipesmanager.c.

Constructor & Destructor Documentation

◆ ~PluginRecipesManager()

void ~PluginRecipesManager ( )
inlineprivate

Definition at line 61 of file pluginrecipesmanager.c.

Member Function Documentation

◆ CallbackGenerateCache()

void CallbackGenerateCache ( )
inlineprivate

Definition at line 165 of file pluginrecipesmanager.c.

References GenerateRecipeCache(), and Debug::Log().

◆ CheckRecipe()

bool CheckRecipe ( int id,
ItemBase item1,
ItemBase item2,
PlayerBase player )
inlineprotected

Definition at line 470 of file pluginrecipesmanager.c.

References m_RecipeList.

Referenced by IsRecipePossibleToPerform(), and PerformRecipeServer().

◆ ClearResults()

void ClearResults ( )
inlineprotected

Definition at line 514 of file pluginrecipesmanager.c.

References m_BitsResults, and MAX_INGREDIENTS.

Referenced by SortIngredientsInRecipe().

◆ CreateAllRecipes()

void CreateAllRecipes ( )
inlineprotected

Definition at line 653 of file pluginrecipesmanager.c.

References RegisterRecipies().

Referenced by PluginRecipesManager().

◆ GenerateHumanReadableRecipeList()

void GenerateHumanReadableRecipeList ( )
inlineprotected

◆ GenerateRecipeCache()

void GenerateRecipeCache ( )
inlineprotected

◆ GetAnimationCommandUID()

int GetAnimationCommandUID ( int recipeID)
inlineprotected

Definition at line 686 of file pluginrecipesmanager.c.

References m_RecipeList.

◆ GetIsInstaRecipe()

bool GetIsInstaRecipe ( int recipe_id)
inlineprivate

Definition at line 145 of file pluginrecipesmanager.c.

References m_RecipeList.

◆ GetIsRepeatable()

bool GetIsRepeatable ( int recipe_id)
inlineprivate

Definition at line 151 of file pluginrecipesmanager.c.

References m_RecipeList.

◆ GetMaxNumberOfRecipes()

int GetMaxNumberOfRecipes ( )
inlinestaticprivate

Definition at line 47 of file pluginrecipesmanager.c.

◆ GetRecipeAnimationInfo()

RecipeAnimationInfo GetRecipeAnimationInfo ( int recipeID,
PlayerBase player,
ItemBase mainItem,
ItemBase target )
inlineprotected

Definition at line 681 of file pluginrecipesmanager.c.

References m_RecipeList.

◆ GetRecipeIntersection()

int GetRecipeIntersection ( int num_of_ingredients,
ItemBase items[] )
inlineprotected

fills an array with recipe IDs which 'item_a' and 'item_b' share

Definition at line 583 of file pluginrecipesmanager.c.

References CacheObject(), GetType(), m_RecipesMatched, PluginRecipesManager(), and x.

Referenced by GetValidRecipesProper().

◆ GetRecipeLengthInSecs()

float GetRecipeLengthInSecs ( int recipe_id)
inlineprivate

Definition at line 133 of file pluginrecipesmanager.c.

References m_RecipeList.

◆ GetRecipeName()

string GetRecipeName ( int recipe_id)
inlineprivate

Definition at line 76 of file pluginrecipesmanager.c.

References m_RecipeList.

Referenced by GenerateHumanReadableRecipeList().

◆ GetRecipesForItem()

array< RecipeBase > GetRecipesForItem ( string itemName)
inlineprotected

Definition at line 386 of file pluginrecipesmanager.c.

References CacheObject(), m_RecipeList, and PluginRecipesManager().

◆ GetRecipeSpecialty()

float GetRecipeSpecialty ( int recipe_id)
inlineprivate

Definition at line 139 of file pluginrecipesmanager.c.

References m_RecipeList.

◆ GetSoundCategory()

string GetSoundCategory ( int recipeID,
ItemBase item1,
ItemBase item2 )
inlineprotected

Definition at line 659 of file pluginrecipesmanager.c.

References m_RecipeList, and SortIngredientsInRecipe().

◆ GetValidRecipes()

int GetValidRecipes ( ItemBase item1,
ItemBase item2,
array< int > ids,
PlayerBase player )
inlineprivate

◆ GetValidRecipesProper()

int GetValidRecipesProper ( int num_of_items,
ItemBase items[],
array< int > ids,
PlayerBase player )
inlineprivate

◆ IsEnableDebugCrafting()

bool IsEnableDebugCrafting ( )
inlineprivate

Definition at line 66 of file pluginrecipesmanager.c.

References m_EnableDebugCrafting.

◆ IsRecipePossibleToPerform()

bool IsRecipePossibleToPerform ( int id,
ItemBase itemA,
ItemBase itemB,
PlayerBase player )
inlineprotected

◆ MatchItems()

void MatchItems ( TStringArray full_path)
inlineprotected

◆ OnInit()

override void OnInit ( )
inlineprivate

Definition at line 157 of file pluginrecipesmanager.c.

◆ PerformRecipeServer()

void PerformRecipeServer ( int id,
ItemBase item_a,
ItemBase item_b,
PlayerBase player )
inlineprotected

◆ PluginRecipesManager()

◆ PrintCache()

void PrintCache ( )
inlineprotected

Definition at line 476 of file pluginrecipesmanager.c.

References CacheObject(), PluginRecipesManager(), and PrintString.

◆ PrintResultMasks()

void PrintResultMasks ( int num)
inlineprotected

Definition at line 574 of file pluginrecipesmanager.c.

References Debug::Log(), and m_BitsResults.

◆ RecipeIDFromClassname()

int RecipeIDFromClassname ( string classname)
inlinestaticprotected

Definition at line 463 of file pluginrecipesmanager.c.

References m_RecipeNamesList.

Referenced by UnregisterRecipe().

◆ RecipeSanityCheck()

bool RecipeSanityCheck ( int num_of_ingredients,
InventoryItemBase items[],
PlayerBase player )
inlineprotected

◆ RegisterRecipe()

void RegisterRecipe ( RecipeBase recipe)
inlineprotected

◆ ResolveIngredients()

bool ResolveIngredients ( int num_of_ingredients,
int passes = 0 )
inlineprotected

◆ SetEnableDebugCrafting()

void SetEnableDebugCrafting ( bool enable)
inlineprivate

Definition at line 71 of file pluginrecipesmanager.c.

References m_EnableDebugCrafting.

◆ SortIngredients()

int SortIngredients ( int num_of_ingredients,
ItemBase items_unsorted[],
int resolved_recipes[] )
inlineprotected

◆ SortIngredientsInRecipe()

bool 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

Definition at line 489 of file pluginrecipesmanager.c.

References CacheObject(), ClearResults(), GetType(), Math::Log2(), m_BitsResults, m_IngredientBitMask, m_IngredientBitMaskSize, PluginRecipesManager(), and ResolveIngredients().

Referenced by GetSoundCategory(), IsRecipePossibleToPerform(), PerformRecipeServer(), and SortIngredients().

◆ UnregisterRecipe()

void UnregisterRecipe ( string clasname)
inlineprotected

Definition at line 450 of file pluginrecipesmanager.c.

References m_RecipeList, m_RecipeNamesList, and RecipeIDFromClassname().

◆ WalkRecipes()

void WalkRecipes ( )
inlineprotected

Field Documentation

◆ item_mask

int item_mask
protected

Definition at line 249 of file pluginrecipesmanager.c.

◆ m_BaseMask

int m_BaseMask
protected

Definition at line 250 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_BaseName

string m_BaseName
protected

Definition at line 247 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_BitsResults

int m_BitsResults[MAX_INGREDIENTS]
private

◆ m_CachedItems

ref array<string> m_CachedItems = new array<string>
private

Definition at line 40 of file pluginrecipesmanager.c.

Referenced by GenerateRecipeCache().

◆ m_CoBase

ref CacheObject m_CoBase
protected

Definition at line 253 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_CoItem

ref CacheObject m_CoItem
protected

Definition at line 252 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_EnableDebugCrafting

bool m_EnableDebugCrafting = false
private

Definition at line 26 of file pluginrecipesmanager.c.

Referenced by IsEnableDebugCrafting(), and SetEnableDebugCrafting().

◆ m_ingredient1

ItemBase m_ingredient1[MAX_CONCURENT_RECIPES]
private

Definition at line 33 of file pluginrecipesmanager.c.

Referenced by GetValidRecipesProper(), and SortIngredients().

◆ m_ingredient2

ItemBase m_ingredient2[MAX_CONCURENT_RECIPES]
private

Definition at line 34 of file pluginrecipesmanager.c.

Referenced by GetValidRecipesProper(), and SortIngredients().

◆ m_ingredient3

ItemBase m_ingredient3[MAX_CONCURENT_RECIPES]
private

Definition at line 35 of file pluginrecipesmanager.c.

◆ m_IngredientBitMask

int m_IngredientBitMask[MAX_INGREDIENTS]
private

Definition at line 28 of file pluginrecipesmanager.c.

Referenced by ResolveIngredients(), and SortIngredientsInRecipe().

◆ m_IngredientBitMaskSize

int m_IngredientBitMaskSize[MAX_INGREDIENTS]
private

Definition at line 29 of file pluginrecipesmanager.c.

Referenced by ResolveIngredients(), and SortIngredientsInRecipe().

◆ m_Ingredients

ItemBase m_Ingredients[MAX_INGREDIENTS]
private

◆ m_ItemName

string m_ItemName
protected

Definition at line 251 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_RcpsArray

ref array<int> m_RcpsArray
protected

Definition at line 246 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_RecipeCache

ref map<string,ref CacheObject > m_RecipeCache = new map<string,ref CacheObject >
staticprivate

Definition at line 14 of file pluginrecipesmanager.c.

Referenced by MatchItems(), and WalkRecipes().

◆ m_RecipeID

int m_RecipeID
protected

Definition at line 248 of file pluginrecipesmanager.c.

Referenced by MatchItems().

◆ m_RecipeList

◆ m_RecipeNamesList

ref map<string, int> m_RecipeNamesList = new map<string, int>
staticprivate

Definition at line 43 of file pluginrecipesmanager.c.

Referenced by RecipeIDFromClassname(), RegisterRecipe(), and UnregisterRecipe().

◆ m_RecipesInitializedItem

ref map<typename, bool> m_RecipesInitializedItem = new map<typename, bool>
staticprivate

Definition at line 15 of file pluginrecipesmanager.c.

◆ m_RecipesMatched

ref array<int> m_RecipesMatched = new array<int>
private

Definition at line 39 of file pluginrecipesmanager.c.

Referenced by GetRecipeIntersection(), and SortIngredients().

◆ m_RegRecipeIndex

int m_RegRecipeIndex
private

Definition at line 23 of file pluginrecipesmanager.c.

Referenced by RegisterRecipe().

◆ m_ResolvedRecipes

int m_ResolvedRecipes[MAX_CONCURENT_RECIPES]
private

Definition at line 24 of file pluginrecipesmanager.c.

Referenced by GetValidRecipesProper().

◆ m_sortedIngredients

ItemBase m_sortedIngredients[MAX_NUMBER_OF_INGREDIENTS]
private

◆ m_TestTimer

ref Timer m_TestTimer
private

Definition at line 18 of file pluginrecipesmanager.c.

◆ MAX_CONCURENT_RECIPES

const int MAX_CONCURENT_RECIPES = 128
private

Definition at line 20 of file pluginrecipesmanager.c.

Referenced by SortIngredients().

◆ MAX_INGREDIENTS

const int MAX_INGREDIENTS = 5
private

Definition at line 21 of file pluginrecipesmanager.c.

Referenced by ClearResults(), and RecipeSanityCheck().

◆ MAX_NUMBER_OF_RECIPES

const int MAX_NUMBER_OF_RECIPES = GetMaxNumberOfRecipes()
private

Definition at line 19 of file pluginrecipesmanager.c.

Referenced by RegisterRecipe().

◆ myTimer1

ref Timer myTimer1
private

Definition at line 45 of file pluginrecipesmanager.c.

Referenced by PluginRecipesManager().


The documentation for this class was generated from the following file: