Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс CraftingManager

Client only - manage set up crafting on client. Подробнее...

Закрытые члены

void CraftingManager (PlayerBase player, PluginRecipesManager recipesManager)
 
void SetRecipeID (int recipeID)
 
int GetRecipeID ()
 
bool IsInventoryCraft ()
 
bool IsWorldCraft ()
 
int GetRecipesCount ()
 
void SetNextRecipe ()
 
void OnUpdate (Object item, Object target, int component_index)
 
bool SetInventoryCraft (int recipeID, ItemBase item1, ItemBase item2)
 
void ResetInventoryCraft ()
 
bool IsEnableDebugCrafting ()
 
int GetRecipeID (int action_index)
 

Закрытые данные

const int CM_MODE_NONE = 0
 
const int CM_MODE_WORLD = 1
 
const int CM_MODE_INVENTORY = 2
 
PlayerBase m_player
 
PluginRecipesManager m_recipesManager
 
ActionVariantManager m_actionVariantManager
 
int m_recipeID
 
int m_contextualRecipeID
 
int m_recipeCount
 
int m_craftingMode
 
ItemBase m_item1
 
ItemBase m_item2
 
ref array< intm_recipes
 

Подробное описание

Client only - manage set up crafting on client.

Конструктор(ы)

◆ CraftingManager()

void CraftingManager ( PlayerBase player,
PluginRecipesManager recipesManager )
inlineprivate
21 {
29 }
Definition ActionManagerClient.c:5
static ActionVariantManager GetVariantManager(typename actionName)
Definition ActionManagerClient.c:253
ScriptInvoker GetOnUpdateInvoker()
Definition ActionVariantsManager.c:14
Definition ActionWorldCraft.c:33
ActionVariantManager m_actionVariantManager
Definition CraftingManager.c:10
PlayerBase m_player
Definition CraftingManager.c:8
const int CM_MODE_NONE
Definition CraftingManager.c:4
ref array< int > m_recipes
Definition CraftingManager.c:18
int m_craftingMode
Definition CraftingManager.c:14
PluginRecipesManager m_recipesManager
Definition CraftingManager.c:9
Definition EntityAI.c:95
proto native void Clear()
remove all calls from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
proto native void OnUpdate()
Definition tools.c:349

Перекрестные ссылки ScriptInvoker::Clear(), CM_MODE_NONE, ActionVariantManager::GetOnUpdateInvoker(), ActionManagerClient::GetVariantManager(), ScriptInvoker::Insert(), m_actionVariantManager, m_craftingMode, m_player, m_recipes, m_recipesManager и OnUpdate().

Методы

◆ GetRecipeID() [1/2]

int GetRecipeID ( )
inlineprivate
37 {
38 return m_recipeID;
39 }
int m_recipeID
Definition CraftingManager.c:11

Перекрестные ссылки m_recipeID.

◆ GetRecipeID() [2/2]

int GetRecipeID ( int action_index)
inlineprivate
176 {
177 return m_recipes[action_index];
178 }

Перекрестные ссылки m_recipes.

◆ GetRecipesCount()

int GetRecipesCount ( )
inlineprivate
52 {
53 return m_recipeCount;
54 }
int m_recipeCount
Definition CraftingManager.c:13

Перекрестные ссылки m_recipeCount.

◆ IsEnableDebugCrafting()

bool IsEnableDebugCrafting ( )
inlineprivate
171 {
172 return true;
173 }

◆ IsInventoryCraft()

bool IsInventoryCraft ( )
inlineprivate
42 {
44 }
const int CM_MODE_INVENTORY
Definition CraftingManager.c:6

Перекрестные ссылки CM_MODE_INVENTORY и m_craftingMode.

◆ IsWorldCraft()

bool IsWorldCraft ( )
inlineprivate
47 {
49 }
const int CM_MODE_WORLD
Definition CraftingManager.c:5

Перекрестные ссылки CM_MODE_WORLD и m_craftingMode.

◆ OnUpdate()

void OnUpdate ( Object item,
Object target,
int component_index )
inlineprivate
62 {
63 ItemBase item1 = ItemBase.Cast( item );
64 ItemBase item2 = ItemBase.Cast( target );
65
66 if ( m_player.GetActionManager().GetRunningAction() )
67 return;
68
69 ItemBase item_in_hands = m_player.GetItemInHands();
70
71 if (!item1 || !item2)
72 {
73 m_recipeCount = 0;
76 return;
77 }
78 else
79 {
80
82 {
85
86 item1.GetInventory().GetCurrentInventoryLocation(il1);
87 item2.GetInventory().GetCurrentInventoryLocation(il2);
88
89 Error("Crafting manager - both of items are out of hands - item1: " + il1.DumpToString() + " item2: " + il2.DumpToString() + " / item in hands: - " + item_in_hands);
90 }
91 }
92
93 int recipeCount = 0;
94
96 {
100 return;
101 }
102
104
105 if (recipeCount == 0)
106 {
107 m_recipeCount = 0;
110 }
111 else
112 {
114 {
118 m_item1 = item1;
119 m_item2 = item2;
120
122 }
124 }
125
126 }
void SetActionVariantCount(int count)
Definition ActionVariantsManager.c:24
void Clear()
Definition ActionVariantsManager.c:19
ItemBase m_item2
Definition CraftingManager.c:16
ItemBase m_item1
Definition CraftingManager.c:15
int m_contextualRecipeID
Definition CraftingManager.c:12
InventoryLocation.
Definition InventoryLocation.c:28
Definition InventoryItem.c:731
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки ActionVariantManager::Clear(), CM_MODE_INVENTORY, CM_MODE_NONE, CM_MODE_WORLD, Error(), m_actionVariantManager, m_contextualRecipeID, m_craftingMode, m_item1, m_item2, m_player, m_recipeCount, m_recipeID, m_recipes, m_recipesManager и ActionVariantManager::SetActionVariantCount().

◆ ResetInventoryCraft()

void ResetInventoryCraft ( )
inlineprivate
165 {
166 m_recipeCount = 0;
168 }

Перекрестные ссылки CM_MODE_NONE, m_craftingMode и m_recipeCount.

◆ SetInventoryCraft()

bool SetInventoryCraft ( int recipeID,
ItemBase item1,
ItemBase item2 )
inlineprivate
129 {
131
132 for ( int i = 0; i < recipeCount; i++ )
133 {
134 if (recipeID == -1 || m_recipes.Get(i) == recipeID)
135 {
136 if ( m_recipesManager.GetIsInstaRecipe(m_recipes.Get(i)) || m_recipesManager.IsEnableDebugCrafting() )
137 {
139 m_player.RPCSingleParam(ERPCs.RPC_CRAFTING_INVENTORY_INSTANT, craftParam, true, m_player.GetIdentity());
140 return true;
141 }
142 else
143 {
147 m_item1 = item1;
148 m_item2 = item2;
149 m_recipeID = m_recipes.Get(i);
150
151 ActionManagerClient am = ActionManagerClient.Cast(m_player.GetActionManager());
152
153 if ( m_player.GetItemInHands() == item1) am.SetInventoryAction( am.GetAction(ActionWorldCraft), item2, item1);
154 else am.SetInventoryAction( am.GetAction(ActionWorldCraft), item1, item2);
155
156 return true;
157 }
158 }
159
160 }
161 return false;
162 }
ERPCs
Definition ERPCs.c:2
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12

Перекрестные ссылки CM_MODE_INVENTORY, m_contextualRecipeID, m_craftingMode, m_item1, m_item2, m_player, m_recipeCount, m_recipeID, m_recipes и m_recipesManager.

◆ SetNextRecipe()

void SetNextRecipe ( )
inlineprivate
57 {
58
59 }

◆ SetRecipeID()

void SetRecipeID ( int recipeID)
inlineprivate
32 {
34 }

Перекрестные ссылки m_recipeID.

Поля

◆ CM_MODE_INVENTORY

const int CM_MODE_INVENTORY = 2
private

Используется в IsInventoryCraft(), OnUpdate() и SetInventoryCraft().

◆ CM_MODE_NONE

const int CM_MODE_NONE = 0
private

Используется в CraftingManager(), OnUpdate() и ResetInventoryCraft().

◆ CM_MODE_WORLD

const int CM_MODE_WORLD = 1
private

Используется в IsWorldCraft() и OnUpdate().

◆ m_actionVariantManager

ActionVariantManager m_actionVariantManager
private

Используется в CraftingManager() и OnUpdate().

◆ m_contextualRecipeID

int m_contextualRecipeID
private

Используется в OnUpdate() и SetInventoryCraft().

◆ m_craftingMode

◆ m_item1

ItemBase m_item1
private

Используется в OnUpdate() и SetInventoryCraft().

◆ m_item2

ItemBase m_item2
private

Используется в OnUpdate() и SetInventoryCraft().

◆ m_player

PlayerBase m_player
private

Используется в CraftingManager(), OnUpdate() и SetInventoryCraft().

◆ m_recipeCount

int m_recipeCount
private

◆ m_recipeID

int m_recipeID
private

Используется в GetRecipeID(), OnUpdate(), SetInventoryCraft() и SetRecipeID().

◆ m_recipes

ref array<int> m_recipes
private

◆ m_recipesManager

PluginRecipesManager m_recipesManager
private

Используется в CraftingManager(), OnUpdate() и SetInventoryCraft().


Объявления и описания членов класса находятся в файле: