DayZ 1.24
Loading...
Searching...
No Matches
ActionTurnOnPowerGenerator Class Reference
Inheritance diagram for ActionTurnOnPowerGenerator:
[legend]
Collaboration diagram for ActionTurnOnPowerGenerator:
[legend]

Private Member Functions

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

Detailed Description

Definition at line 1 of file ActionTurnOnPowerGenerator.c.

Constructor & Destructor Documentation

◆ ActionTurnOnPowerGenerator()

void ActionTurnOnPowerGenerator::ActionTurnOnPowerGenerator ( )
inlineprivate

Definition at line 3 of file ActionTurnOnPowerGenerator.c.

4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_Text = "#switch_on";
7 }
string m_Text
Definition ActionBase.c:49
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionTurnOnPowerGenerator::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 9 of file ActionTurnOnPowerGenerator.c.

10 {
11 PowerGeneratorBase pg = PowerGeneratorBase.Cast(target.GetObject());
12
13 if (pg)
14 {
15 if (pg.HasEnergyManager() && pg.GetCompEM().CanSwitchOn() && pg.HasSparkplug() && pg.GetCompEM().CanWork())
16 return true;
17 }
18
19 return false;
20 }

◆ OnExecuteServer()

override void ActionTurnOnPowerGenerator::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 22 of file ActionTurnOnPowerGenerator.c.

23 {
24 Object targetObject = action_data.m_Target.GetObject();
25 if (targetObject)
26 {
28 target_IB.GetCompEM().SwitchOn();
29 target_IB.GetCompEM().InteractBranch(target_IB);
30 }
31 }

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