Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionDetachPowerSourceFromPanel
+ Граф наследования:ActionDetachPowerSourceFromPanel:

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

void ActionDetachPowerSourceFromPanel ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteClient (ActionData action_data)
 
override void OnExecuteServer (ActionData action_data)
 
void Process (ActionData action_data)
 

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

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

◆ ActionDetachPowerSourceFromPanel()

5 {
6 m_Text = "#detach_power_source";
7 }
string m_Text
Definition ActionBase.c:49

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

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
10 {
11 Object target_object = target.GetObject();
12
13 if ( player && target_object )
14 {
15 EntityAI target_entity = EntityAI.Cast( target.GetObject() );
16 string selection = target_object.GetActionComponentName( target.GetComponentIndex() );
17
18
19 if ( target_entity && target_entity.GetInventory() && target_entity.GetInventory().AttachmentCount() > 0 && selection == "power_source" ) //has any power source attachment attached
20 {
21 return true;
22 }
23 }
24
25 return false;
26 }
Definition Building.c:6
Definition ObjectTyped.c:2
Definition EntityAI.c:95

◆ OnExecuteClient()

override void OnExecuteClient ( ActionData action_data)
inlineprivate
29 {
31 }
void Process(ActionData action_data)
Definition ActionDetachPowerSourceFromPanel.c:38

Перекрестные ссылки Process().

◆ OnExecuteServer()

override void OnExecuteServer ( ActionData action_data)
inlineprivate
34 {
36 }

Перекрестные ссылки Process().

◆ Process()

void Process ( ActionData action_data)
inlineprivate
39 {
40 EntityAI target_entity = EntityAI.Cast( action_data.m_Target.GetObject() );
41
43 int attachments_count = target_entity.GetInventory().AttachmentCount();
44 for ( int j = 0; j < attachments_count; j++ ) //find any attached power source
45 {
46 // @TODO: vezme prvni att?
47 attachment = target_entity.GetInventory().GetAttachmentFromIndex( j );
48 if ( attachment )
49 break;
50 }
51
52 if ( attachment )
53 {
54 action_data.m_Player.PredictiveTakeEntityToHands(attachment );
55 }
56 }

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


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