Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
ComponentEnergyManager Class Reference
Inheritance diagram for ComponentEnergyManager:
Component

Protected Member Functions

void ComponentEnergyManager ()
void ~ComponentEnergyManager ()
float AddEnergy (float added_energy)
 Energy manager: Adds energy to this device and clamps it within its min/max storage limits. Returns the amount of energy that was clamped. Negative value is supported, but you should still use ConsumeEnergy(...) for propper substraction of energy.
bool CanBePluggedInto (EntityAI potential_energy_provider)
 Energy manager: Returns true if this device can be plugged into the given energy source. Otherwise returns false.
bool CanReceivePlugFrom (EntityAI device_to_plug)
 Energy manager: Returns true if this device can receive power plug of the other device.
bool CanSwitchOff ()
 Energy manager: Checks if the device can be switched OFF.
bool CanSwitchOn ()
 Energy manager: Checks if the device can be switched ON.
bool CanWork (float test_energy=-1)
 Energy manager: Checks whenever this device can do work or not.
bool CheckWetness ()
 Energy manager: Checks if this device is being stopped from working by its wetness level. Returns true when its wetness is not blocking it, false when its to owet to work.
void ClearLastUpdateTime ()
bool ConsumeEnergy (float amount)
 Energy manager: Consumes the given amount of energy. If there is not enough of stored energy in this device, then it tries to take it from its power source, if any exists. Returns true if the requested amount of energy was consumed. Otherwise it returns false.
void DebugUpdate ()
void DeviceUpdate ()
Shape DrawArrow (vector from, vector to, float size=0.5, int color=0xFFFFFFFF, float flags=0)
override void Event_OnAwake ()
override void Event_OnInit ()
bool FindAndConsumeEnergy (EntityAI original_caller, float amount, bool ignore_switch_state=false)
int GetAttachmentAction ()
void GetCompatiblePlugTypes (out TIntArray IDs)
override int GetCompType ()
float GetCordLength ()
 Energy manager: Returns the length of the virtual power cord.
string GetCordTextureFile ()
 Energy manager: Returns path to the cord texture file.
float GetCurrentUpdateTime ()
bool GetDebugPlugs ()
EntityAI GetDeviceBySocketID (int id)
 Energy manager: Returns the device which is plugged into the given socket ID.
float GetEnergy ()
 Energy manager: Returns the amount of stored energy this device has.
float GetEnergy0To1 ()
 Energy manager: Returns % of stored energy this device has as float (from 0.0 to 1.0).
int GetEnergy0To100 ()
 Energy manager: Returns % of stored energy this device has as integer (from 0 to 100).
float GetEnergyAtSpawn ()
float GetEnergyMax ()
 Energy manager: Returns the maximum amount of energy this device can curently store. If parameter 'reduceMaxEnergyByDamageCoef' is used in the config of this device then the returned value will be reduced by damage.
float GetEnergyMaxPristine ()
 Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken into account.
EntityAI GetEnergySource ()
 Energy manager: Returns the energy source this device is plugged into.
int GetEnergySourceNetworkIDHigh ()
int GetEnergySourceNetworkIDLow ()
int GetEnergySourceStorageIDb1 ()
int GetEnergySourceStorageIDb2 ()
int GetEnergySourceStorageIDb3 ()
int GetEnergySourceStorageIDb4 ()
float GetEnergyUsage ()
 Energy manager: Returns the number of energy this device needs to run itself (See its config >> energyUsagePerSecond).
int GetMySocketID ()
EntityAI GetPluggedDevice ()
 Energy manager: Returns a device which is plugged into this one. If there are more devices to choose from then it returns the first one that is found.
array< EntityAIGetPluggedDevices ()
 Energy manager: Returns an array of devices which are plugged into this one.
int GetPluggedDevicesCount ()
 Energy manager: Returns the number of devices plugged into this one.
EntityAI GetPlugOwner (string plug_selection_name)
 Energy manager: Returns the device to which the given plug selection belongs to.
int GetPlugType ()
 Energy manager: Returns plug type. Check \DZ\data\basicDefines.hpp OR \Scripts\Classes\Component_constants.h files for types of plugs.
array< EntityAIGetPoweredDevices ()
 Energy manager: Returns an array of devices which are plugged into this one and are turned on.
bool GetPreviousSwitchState ()
bool GetRestorePlugState ()
int GetSocketsCount ()
 Energy manager: Returns the count of power sockets (whenever used or not).
EntityAI GetThisEntityAI ()
float GetUpdateInterval ()
 Energy manager: Returns the update interval of this device.
float GetWetnessExposure ()
 Returns wetness exposure value defined in config.
void HandleMoveInsideCargo (EntityAI container)
bool HasConversionOfEnergyToQuantity ()
 Energy manager: Returns true if this item automatically converts its energy to quantity.
bool HasElectricityIcon ()
 Energy manager: Returns true if the electricity icon (bolt) is supposed to be visible for this device. False if not.
bool HasEnoughStoredEnergy ()
 Energy manager: Returns true if this device has enough of stored energy for its own use.
bool HasFreeSocket (int socket_id=-1)
 Energy manager: Returns true if this device has any free socket to receive a plug. If optional parameter socket_id is provided then only that socket ID is checked.
bool HasVisibleSocketsInInventory ()
void InteractBranch (EntityAI originalCaller, Man player=null, int system=0)
 Gets called originally when the player is interacting with an item containing this energy component, then recursively following the branches of connection from the original item to the peripheries External calling of this function is not automatic for all item interactions and may need to be implemented on case by case bases Avoid using for gameplay logic, use 'OnInteractBranch' instead.
bool IsCordFolded ()
 Energy manager: Returns true if the cord of this device is folded. Returns false if it's plugged.
bool IsEnergySourceAtReach (vector from_position, float add_tolerance=0, vector override_source_position="-1 -1 -1")
 Energy manager: Returns true if this device's virtual power cord can reach its energy source at the given position, depending on its cordLength config parameter.
bool IsPassive ()
 Energy manager: Returns true if this device is set to be passive. False if otherwise.
bool IsPlugCompatible (int plug_ID)
 Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceivePlugFrom() method.
bool IsPlugged ()
 Energy manager: Returns true if this device is plugged into some other device (even if they are OFF or ruined). Otherwise it returns false.
bool IsSelectionAPlug (string selection_to_test)
 Energy manager: Returns true if this selection is a plug that's plugged into this device. Otherwise returns false.
bool IsSwitchedOn ()
 Energy manager: Returns state of the switch. Whenever the device is working or not does not matter. Use IsWorking() to account for that as well.
bool IsWorking ()
 Energy manager: Returns true if this device is working right now.
void OnAttachmentAdded (EntityAI elec_device)
void OnAttachmentRemoved (EntityAI elec_device)
void OnDeviceDestroyed ()
void OnEnergyAdded ()
 Energy manager: Called when energy was added on this device.
void OnEnergyConsumed ()
 Energy manager: Called when energy was consumed on this device.
void OnInteractBranch (EntityAI originalCaller, Man player, int system)
 Called when the player is interacting with an item containing this energy component, or when interacting with an item this device is connected to.
void OnIsPlugged (EntityAI source_device)
void OnIsUnplugged (EntityAI last_energy_source)
void OnOwnSocketReleased (EntityAI device)
void OnOwnSocketTaken (EntityAI device)
void OnWork (float consumed_energy)
void PlugCordIntoSocket (EntityAI device_to_plug, int socket_id=-1)
bool PlugInDevice (EntityAI device_to_plug, int socket_id=-1)
bool PlugThisInto (EntityAI energy_source, int socket_id=-1)
 Energy manager: Attempts to plug this device into the energy_source. Returns true if the action was successfull, or false if not (due to plug incompatibility or no free socket on the receiver). The ID of the power socket is chosen automatically unless optional parameter socket_id is used (starting from 0). If the given ID is not free then a free socket is found.
void RefreshDebug ()
void RememberLastUpdateTime ()
void ResetEnergyUsage ()
 Energy manager: Resets energy usage to default (config) value.
void RestorePlugState (bool state)
void SetAttachmentAction (int new_action_type)
void SetCordLength (float new_length)
 Energy manager: Changes the length of the virtual power cord.
void SetCordTextureFile (string new_path)
void SetDebugPlugs (bool newVal)
void SetDeviceBySocketID (int id, EntityAI plugged_device)
 Energy manager: Stores the device which is plugged into the given socket ID.
void SetElectricityIconVisibility (bool make_visible)
 Energy manager: Sets visibility of the electricity icon (bolt).
void SetEnergy (float new_energy)
 Energy manager: Sets stored energy for this device. It ignores the min/max limit!
void SetEnergy0To1 (float energy01)
 Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value between 0 and 1.
void SetEnergyMaxPristine (float new_limit)
 Energy manager: Changes the maximum amount of energy this device can store (when pristine).
void SetEnergySource (EntityAI source)
void SetEnergySourceClient (EntityAI source)
void SetEnergyUsage (float new_usage)
 Energy manager: Changes the energy usage per second.
void SetMySocketID (int slot_ID)
void SetPassiveState (bool state=true)
 Energy manager: Changes the status of this device. When it's passive (true), the main timer and OnWork events are not used.
void SetPlugOwner (string selection_name, EntityAI device)
void SetPlugType (int new_type)
void SetPowered (bool state)
void SetUpdateInterval (float value)
 Energy manager: Sets the interval of the OnWork(...) calls. Changing this value does not change the rate of energy consumption.
void StartUpdates ()
void StopUpdates ()
void StoreEnergySourceIDs (int b1, int b2, int b3, int b4)
void SwitchOff ()
 Energy manager: Switches OFF the device.
void SwitchOn ()
 Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
void Synch ()
void UnplugAllDevices ()
 Energy manager: Unplugs everything directly connected to this device.
void UnplugCordFromSocket (int socket_to_unplug_ID)
void UnplugDevice (EntityAI device_to_unplug)
 Energy manager: Unplugs the given device from this one.
void UnplugThis ()
 Energy manager: Unplugs this device from its power source.
void UpdateCanWork ()
void UpdatePlugState ()
 Energy manager: Unplugs this device when it's necesarry.
void UpdateSelections ()
 Energy manager: Shows/Hides all selections this system works with. Call this if something is wrong with selections (like during Init and Restore event in config).
void UpdateSocketSelections (int socket_id, EntityAI device_to_plug)
void WakeUpWholeBranch (EntityAI original_caller)

Protected Attributes

const float DEFAULT_UPDATE_INTERVAL = 15
int m_AttachmentActionType
bool m_AutoSwitchOff
bool m_AutoSwitchOffWhenInCargo
bool m_CanStopWork
bool m_CanWork
ref TIntArray m_CompatiblePlugTypes
bool m_ConvertEnergyToQuantity
float m_CordLength
string m_CordTextureFile
Shape m_DebugPlugArrow
ref Timer m_DebugUpdate
ref map< string, EntityAIm_DeviceByPlugSelection
float m_Energy
float m_EnergyAtSpawn
EntityAI m_EnergySource
int m_EnergySourceNetworkIDHigh = -1
int m_EnergySourceNetworkIDLow = -1
int m_EnergySourceStorageIDb1
int m_EnergySourceStorageIDb2
int m_EnergySourceStorageIDb3
int m_EnergySourceStorageIDb4
float m_EnergyStorageMax
float m_EnergyUsage
bool m_HasElectricityIcon
bool m_IsPassiveDevice
bool m_IsPlugged
bool m_IsSwichedOn
bool m_IsSwichedOnPreviousState
bool m_IsWorking
float m_LastUpdateTime
int m_MySocketID = -1
ref array< EntityAIm_PluggedDevices
int m_PlugType
float m_ReduceMaxEnergyByDamageCoef
bool m_RestorePlugState
bool m_ShowSocketsInInventory
EntityAI m_Sockets [MAX_SOCKETS_COUNT]
float m_SocketsCount
float m_UpdateInterval
ref Timer m_UpdateQuantityTimer
ref Timer m_UpdateTimer
float m_WetnessExposure
const int MAX_SOCKETS_COUNT = 4

Static Protected Attributes

static const string _AVAILABLE = "_available"
static const string _PLUGGED = "_plugged"
static bool m_DebugPlugs = false
static const string SEL_CORD_FOLDED = "cord_folded"
static const string SEL_CORD_PLUGGED = "cord_plugged"
static const string SOCKET_ = "socket_"

Additional Inherited Members

Private Member Functions inherited from Component
void DebugBBoxDelete ()
override void DebugBBoxDelete ()
Shape DebugBBoxDraw ()
override Shape DebugBBoxDraw ()
void DebugBBoxSetColor (int color)
override void DebugBBoxSetColor (int color)
void DebugDirectionDelete ()
override void DebugDirectionDelete ()
Shape DebugDirectionDraw (float distance=1)
override Shape DebugDirectionDraw (float distance=1)
void DebugDirectionSetColor (int color)
void Event_OnAwake ()
void Event_OnFrame (IEntity other, float timeSlice)
void Event_OnInit ()
void Event_OnItemAttached (EntityAI item, string slot_name)
void Event_OnItemDetached (EntityAI item, string slot_name)
string GetCompName ()
int GetCompType ()
void LogThis (string msg, string fnc_name="n/a")
void LogThisError (string msg, string fnc_name="n/a")
void LogThisWarning (string msg, string fnc_name="n/a")
void OnDrawing ()
void SetParentEntityAI (EntityAI e)
Static Private Member Functions inherited from Component
static string GetNameByType (int comp_type)
static void Init ()
static bool IsTypeExist (int comp_type)
static void LogErrorBadCompType (int comp_type, string fnc_name)
static void LogWarningAlredyExist (int comp_type, string fnc_name)
Private Attributes inherited from Component
Shape m_DebugShapeBBox
Shape m_DebugShapeDirection
float m_DebugShapeDirectionDist
EntityAI m_ThisEntityAI

Detailed Description

Definition at line 18 of file componentenergymanager.c.

Constructor & Destructor Documentation

◆ ComponentEnergyManager()

void ComponentEnergyManager ( )
inlineprotected

Definition at line 83 of file componentenergymanager.c.

References m_DebugPlugs.

◆ ~ComponentEnergyManager()

void ~ComponentEnergyManager ( )
inlineprotected

Definition at line 91 of file componentenergymanager.c.

References m_DebugPlugArrow.

Member Function Documentation

◆ AddEnergy()

float AddEnergy ( float added_energy)
inlineprotected

Energy manager: Adds energy to this device and clamps it within its min/max storage limits. Returns the amount of energy that was clamped. Negative value is supported, but you should still use ConsumeEnergy(...) for propper substraction of energy.

Definition at line 1265 of file componentenergymanager.c.

References Math::Clamp(), GetEnergy(), GetEnergyMax(), OnEnergyAdded(), OnEnergyConsumed(), SetEnergy(), and StartUpdates().

Referenced by FindAndConsumeEnergy(), and ItemBase::OnIgnitedTarget().

◆ CanBePluggedInto()

bool CanBePluggedInto ( EntityAI potential_energy_provider)
inlineprotected

Energy manager: Returns true if this device can be plugged into the given energy source. Otherwise returns false.

Definition at line 1036 of file componentenergymanager.c.

References Component::m_ThisEntityAI.

◆ CanReceivePlugFrom()

bool CanReceivePlugFrom ( EntityAI device_to_plug)
inlineprotected

Energy manager: Returns true if this device can receive power plug of the other device.

Definition at line 1015 of file componentenergymanager.c.

References HasFreeSocket(), IsPlugCompatible(), and Component::m_ThisEntityAI.

Referenced by PlugInDevice().

◆ CanSwitchOff()

bool CanSwitchOff ( )
inlineprotected

Energy manager: Checks if the device can be switched OFF.

Definition at line 880 of file componentenergymanager.c.

References IsPassive(), and IsSwitchedOn().

Referenced by SwitchOff().

◆ CanSwitchOn()

bool CanSwitchOn ( )
inlineprotected

Energy manager: Checks if the device can be switched ON.

Definition at line 765 of file componentenergymanager.c.

References IsSwitchedOn().

Referenced by SwitchOn().

◆ CanWork()

bool CanWork ( float test_energy = -1)
inlineprotected

Energy manager: Checks whenever this device can do work or not.

Parameters
test_energyfloat optional parameter will overwite the default energy consumption value of this device.
Returns
bool Returns true if this device will work when it's switched on. Otherwise it returns false.

Definition at line 781 of file componentenergymanager.c.

References CheckWetness(), DPrint(), g_Game, GetEnergy(), GetEnergySource(), GetEnergyUsage(), m_CanWork, and Component::m_ThisEntityAI.

Referenced by UpdateCanWork().

◆ CheckWetness()

bool CheckWetness ( )
inlineprotected

Energy manager: Checks if this device is being stopped from working by its wetness level. Returns true when its wetness is not blocking it, false when its to owet to work.

Definition at line 867 of file componentenergymanager.c.

References Component::m_ThisEntityAI, and m_WetnessExposure.

Referenced by CanWork(), and DeviceUpdate().

◆ ClearLastUpdateTime()

void ClearLastUpdateTime ( )
inlineprotected

Definition at line 1795 of file componentenergymanager.c.

References m_LastUpdateTime.

Referenced by DeviceUpdate().

◆ ConsumeEnergy()

bool ConsumeEnergy ( float amount)
inlineprotected

Energy manager: Consumes the given amount of energy. If there is not enough of stored energy in this device, then it tries to take it from its power source, if any exists. Returns true if the requested amount of energy was consumed. Otherwise it returns false.

Definition at line 925 of file componentenergymanager.c.

References FindAndConsumeEnergy(), and Component::m_ThisEntityAI.

Referenced by DeviceUpdate().

◆ DebugUpdate()

◆ DeviceUpdate()

◆ DrawArrow()

Shape DrawArrow ( vector from,
vector to,
float size = 0.5,
int color = 0xFFFFFFFF,
float flags = 0 )
inlineprotected

Definition at line 153 of file componentenergymanager.c.

References vector::Normalize(), vector::Perpend(), and Shape.

Referenced by DebugUpdate().

◆ Event_OnAwake()

◆ Event_OnInit()

override void Event_OnInit ( )
inlineprotected

Definition at line 101 of file componentenergymanager.c.

References g_Game, and Component::m_ThisEntityAI.

◆ FindAndConsumeEnergy()

bool FindAndConsumeEnergy ( EntityAI original_caller,
float amount,
bool ignore_switch_state = false )
inlineprotected

◆ GetAttachmentAction()

int GetAttachmentAction ( )
inlineprotected

Definition at line 1159 of file componentenergymanager.c.

References m_AttachmentActionType.

Referenced by OnAttachmentAdded(), and OnAttachmentRemoved().

◆ GetCompatiblePlugTypes()

void GetCompatiblePlugTypes ( out TIntArray IDs)
inlineprotected

Definition at line 627 of file componentenergymanager.c.

References m_CompatiblePlugTypes.

◆ GetCompType()

override int GetCompType ( )
inlineprotected

Definition at line 322 of file componentenergymanager.c.

References COMP_TYPE_ENERGY_MANAGER.

◆ GetCordLength()

float GetCordLength ( )
inlineprotected

Energy manager: Returns the length of the virtual power cord.

Definition at line 1331 of file componentenergymanager.c.

References m_CordLength.

Referenced by IsEnergySourceAtReach().

◆ GetCordTextureFile()

string GetCordTextureFile ( )
inlineprotected

Energy manager: Returns path to the cord texture file.

Definition at line 1371 of file componentenergymanager.c.

References m_CordTextureFile.

◆ GetCurrentUpdateTime()

float GetCurrentUpdateTime ( )
inlineprotected

Definition at line 1805 of file componentenergymanager.c.

References g_Game.

Referenced by DeviceUpdate(), and RememberLastUpdateTime().

◆ GetDebugPlugs()

bool GetDebugPlugs ( )
inlineprotected

Definition at line 366 of file componentenergymanager.c.

References m_DebugPlugs.

Referenced by DebugUpdate().

◆ GetDeviceBySocketID()

EntityAI GetDeviceBySocketID ( int id)
inlineprotected

Energy manager: Returns the device which is plugged into the given socket ID.

Definition at line 1343 of file componentenergymanager.c.

References m_Sockets.

Referenced by HasFreeSocket(), PlugCordIntoSocket(), UnplugCordFromSocket(), and UpdateSelections().

◆ GetEnergy()

float GetEnergy ( )
inlineprotected

Energy manager: Returns the amount of stored energy this device has.

Definition at line 1259 of file componentenergymanager.c.

References m_Energy.

Referenced by AddEnergy(), CanWork(), ItemBase::HasEnoughEnergyForRepair(), HasEnoughStoredEnergy(), and TransferEntityVariables().

◆ GetEnergy0To1()

float GetEnergy0To1 ( )
inlineprotected

Energy manager: Returns % of stored energy this device has as float (from 0.0 to 1.0).

Definition at line 1224 of file componentenergymanager.c.

References m_Energy, and m_EnergyStorageMax.

◆ GetEnergy0To100()

int GetEnergy0To100 ( )
inlineprotected

Energy manager: Returns % of stored energy this device has as integer (from 0 to 100).

Definition at line 1212 of file componentenergymanager.c.

References m_Energy, m_EnergyStorageMax, and Math::Round().

◆ GetEnergyAtSpawn()

float GetEnergyAtSpawn ( )
inlineprotected

Definition at line 1325 of file componentenergymanager.c.

References m_EnergyAtSpawn.

Referenced by InventoryItem::SetCEBasedQuantity().

◆ GetEnergyMax()

float GetEnergyMax ( )
inlineprotected

Energy manager: Returns the maximum amount of energy this device can curently store. If parameter 'reduceMaxEnergyByDamageCoef' is used in the config of this device then the returned value will be reduced by damage.

Definition at line 1297 of file componentenergymanager.c.

References g_Game, GetEnergyMaxPristine(), m_ReduceMaxEnergyByDamageCoef, and Component::m_ThisEntityAI.

Referenced by AddEnergy(), and SetEnergy0To1().

◆ GetEnergyMaxPristine()

float GetEnergyMaxPristine ( )
inlineprotected

Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken into account.

Definition at line 1320 of file componentenergymanager.c.

References m_EnergyStorageMax.

Referenced by GetEnergyMax(), and InventoryItem::SetCEBasedQuantity().

◆ GetEnergySource()

EntityAI GetEnergySource ( )
inlineprotected

Energy manager: Returns the energy source this device is plugged into.

Definition at line 1337 of file componentenergymanager.c.

References m_EnergySource.

Referenced by CanWork(), DebugUpdate(), FindAndConsumeEnergy(), Entity::GetDebugText(), IsEnergySourceAtReach(), OnAttachmentRemoved(), UnplugThis(), and UpdateSelections().

◆ GetEnergySourceNetworkIDHigh()

int GetEnergySourceNetworkIDHigh ( )
inlineprotected

Definition at line 1195 of file componentenergymanager.c.

References m_EnergySourceNetworkIDHigh.

◆ GetEnergySourceNetworkIDLow()

int GetEnergySourceNetworkIDLow ( )
inlineprotected

Definition at line 1189 of file componentenergymanager.c.

References m_EnergySourceNetworkIDLow.

◆ GetEnergySourceStorageIDb1()

int GetEnergySourceStorageIDb1 ( )
inlineprotected

Definition at line 1165 of file componentenergymanager.c.

References m_EnergySourceStorageIDb1.

◆ GetEnergySourceStorageIDb2()

int GetEnergySourceStorageIDb2 ( )
inlineprotected

Definition at line 1171 of file componentenergymanager.c.

References m_EnergySourceStorageIDb2.

◆ GetEnergySourceStorageIDb3()

int GetEnergySourceStorageIDb3 ( )
inlineprotected

Definition at line 1177 of file componentenergymanager.c.

References m_EnergySourceStorageIDb3.

◆ GetEnergySourceStorageIDb4()

int GetEnergySourceStorageIDb4 ( )
inlineprotected

Definition at line 1183 of file componentenergymanager.c.

References m_EnergySourceStorageIDb4.

◆ GetEnergyUsage()

float GetEnergyUsage ( )
inlineprotected

Energy manager: Returns the number of energy this device needs to run itself (See its config >> energyUsagePerSecond).

Definition at line 1253 of file componentenergymanager.c.

References m_EnergyUsage.

Referenced by CanWork(), DeviceUpdate(), HasEnoughStoredEnergy(), and SetEnergy().

◆ GetMySocketID()

int GetMySocketID ( )
inlineprotected

Definition at line 1778 of file componentenergymanager.c.

References m_MySocketID.

◆ GetPluggedDevice()

EntityAI GetPluggedDevice ( )
inlineprotected

Energy manager: Returns a device which is plugged into this one. If there are more devices to choose from then it returns the first one that is found.

Definition at line 1360 of file componentenergymanager.c.

References GetPluggedDevices(), and GetPluggedDevicesCount().

◆ GetPluggedDevices()

array< EntityAI > GetPluggedDevices ( )
inlineprotected

Energy manager: Returns an array of devices which are plugged into this one.

Definition at line 1377 of file componentenergymanager.c.

References m_PluggedDevices.

Referenced by GetPluggedDevice(), GetPluggedDevicesCount(), GetPoweredDevices(), InteractBranch(), IsSelectionAPlug(), PlugInDevice(), UnplugAllDevices(), UnplugDevice(), and WakeUpWholeBranch().

◆ GetPluggedDevicesCount()

int GetPluggedDevicesCount ( )
inlineprotected

Energy manager: Returns the number of devices plugged into this one.

Definition at line 1201 of file componentenergymanager.c.

References GetPluggedDevices().

Referenced by GetPluggedDevice(), GetPoweredDevices(), HasFreeSocket(), UnplugAllDevices(), and UnplugDevice().

◆ GetPlugOwner()

EntityAI GetPlugOwner ( string plug_selection_name)
inlineprotected

Energy manager: Returns the device to which the given plug selection belongs to.

Definition at line 1349 of file componentenergymanager.c.

References m_DeviceByPlugSelection.

◆ GetPlugType()

int GetPlugType ( )
inlineprotected

Energy manager: Returns plug type. Check \DZ\data\basicDefines.hpp OR \Scripts\Classes\Component_constants.h files for types of plugs.

Definition at line 1153 of file componentenergymanager.c.

References m_PlugType.

◆ GetPoweredDevices()

array< EntityAI > GetPoweredDevices ( )
inlineprotected

Energy manager: Returns an array of devices which are plugged into this one and are turned on.

Definition at line 1383 of file componentenergymanager.c.

References GetPluggedDevices(), GetPluggedDevicesCount(), and IsSwitchedOn().

◆ GetPreviousSwitchState()

bool GetPreviousSwitchState ( )
inlineprotected

Definition at line 891 of file componentenergymanager.c.

References m_IsSwichedOnPreviousState.

◆ GetRestorePlugState()

bool GetRestorePlugState ( )
inlineprotected

Definition at line 746 of file componentenergymanager.c.

References m_RestorePlugState.

◆ GetSocketsCount()

int GetSocketsCount ( )
inlineprotected

Energy manager: Returns the count of power sockets (whenever used or not).

Definition at line 1147 of file componentenergymanager.c.

References m_SocketsCount.

Referenced by Event_OnAwake(), HasFreeSocket(), InteractBranch(), IsSelectionAPlug(), PlugCordIntoSocket(), UpdateSelections(), and WakeUpWholeBranch().

◆ GetThisEntityAI()

EntityAI GetThisEntityAI ( )
inlineprotected

Definition at line 172 of file componentenergymanager.c.

References Component::m_ThisEntityAI.

◆ GetUpdateInterval()

float GetUpdateInterval ( )
inlineprotected

Energy manager: Returns the update interval of this device.

Definition at line 1235 of file componentenergymanager.c.

References m_UpdateInterval.

Referenced by StartUpdates().

◆ GetWetnessExposure()

float GetWetnessExposure ( )
inlineprotected

Returns wetness exposure value defined in config.

Definition at line 1247 of file componentenergymanager.c.

References m_WetnessExposure.

◆ HandleMoveInsideCargo()

void HandleMoveInsideCargo ( EntityAI container)
inlineprotected

Definition at line 728 of file componentenergymanager.c.

References IsSwitchedOn(), m_AutoSwitchOffWhenInCargo, and SwitchOff().

◆ HasConversionOfEnergyToQuantity()

bool HasConversionOfEnergyToQuantity ( )
inlineprotected

Energy manager: Returns true if this item automatically converts its energy to quantity.

Definition at line 1055 of file componentenergymanager.c.

References m_ConvertEnergyToQuantity.

◆ HasElectricityIcon()

bool HasElectricityIcon ( )
inlineprotected

Energy manager: Returns true if the electricity icon (bolt) is supposed to be visible for this device. False if not.

Definition at line 1049 of file componentenergymanager.c.

References m_HasElectricityIcon.

◆ HasEnoughStoredEnergy()

bool HasEnoughStoredEnergy ( )
inlineprotected

Energy manager: Returns true if this device has enough of stored energy for its own use.

Definition at line 944 of file componentenergymanager.c.

References GetEnergy(), and GetEnergyUsage().

Referenced by Event_OnAwake().

◆ HasFreeSocket()

bool HasFreeSocket ( int socket_id = -1)
inlineprotected

Energy manager: Returns true if this device has any free socket to receive a plug. If optional parameter socket_id is provided then only that socket ID is checked.

Definition at line 955 of file componentenergymanager.c.

References GetDeviceBySocketID(), GetPluggedDevicesCount(), and GetSocketsCount().

Referenced by CanReceivePlugFrom().

◆ HasVisibleSocketsInInventory()

bool HasVisibleSocketsInInventory ( )
inlineprotected

Definition at line 1117 of file componentenergymanager.c.

References m_ShowSocketsInInventory.

◆ InteractBranch()

void InteractBranch ( EntityAI originalCaller,
Man player = null,
int system = 0 )
inlineprotected

Gets called originally when the player is interacting with an item containing this energy component, then recursively following the branches of connection from the original item to the peripheries External calling of this function is not automatic for all item interactions and may need to be implemented on case by case bases Avoid using for gameplay logic, use 'OnInteractBranch' instead.

Definition at line 1561 of file componentenergymanager.c.

References GetPluggedDevices(), GetSocketsCount(), and OnInteractBranch().

Referenced by PlugInDevice().

◆ IsCordFolded()

bool IsCordFolded ( )
inlineprotected

Energy manager: Returns true if the cord of this device is folded. Returns false if it's plugged.

Definition at line 903 of file componentenergymanager.c.

References IsPlugged().

◆ IsEnergySourceAtReach()

bool IsEnergySourceAtReach ( vector from_position,
float add_tolerance = 0,
vector override_source_position = "-1 -1 -1" )
inlineprotected

Energy manager: Returns true if this device's virtual power cord can reach its energy source at the given position, depending on its cordLength config parameter.

Otherwise returns false.

Parameters
from_positionvector position from where the measurement will be taken
add_tolerancefloat parameter will add to the cord's length in meters (optional)
Returns
bool True if the power source will be at reach for the plug, or if config param cordLength is absent or 0. False if not, or is not plugged, or this device lacks Energy Manager component.
vector position_player = g_Game.GetPlayer().GetPosition();
if ( my_device.GetCompEM().IsEnergySourceAtReach( position_player ) )
{
Print("Power source is at reach!");
}else{
Print("Power source is NOT at reach!");
}
DayZGame g_Game
Definition dayzgame.c:3942
proto void Print(void var)
Prints content of variable to console/log.

Definition at line 1076 of file componentenergymanager.c.

References vector::Distance(), GetCordLength(), GetEnergySource(), and IsPlugged().

Referenced by Hologram::CorrectMaterialPathName(), and UpdatePlugState().

◆ IsPassive()

bool IsPassive ( )
inlineprotected

Energy manager: Returns true if this device is set to be passive. False if otherwise.

Definition at line 912 of file componentenergymanager.c.

References m_IsPassiveDevice.

Referenced by CanSwitchOff().

◆ IsPlugCompatible()

bool IsPlugCompatible ( int plug_ID)
inlineprotected

Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceivePlugFrom() method.

Definition at line 985 of file componentenergymanager.c.

References m_CompatiblePlugTypes, and PLUG_UNDEFINED.

Referenced by CanReceivePlugFrom(), and Event_OnAwake().

◆ IsPlugged()

bool IsPlugged ( )
inlineprotected

Energy manager: Returns true if this device is plugged into some other device (even if they are OFF or ruined). Otherwise it returns false.

Definition at line 918 of file componentenergymanager.c.

References m_IsPlugged.

Referenced by Hologram::CorrectMaterialPathName(), FindAndConsumeEnergy(), IsCordFolded(), and IsEnergySourceAtReach().

◆ IsSelectionAPlug()

bool IsSelectionAPlug ( string selection_to_test)
inlineprotected

Energy manager: Returns true if this selection is a plug that's plugged into this device. Otherwise returns false.

Definition at line 1123 of file componentenergymanager.c.

References _PLUGGED, GetPluggedDevices(), GetSocketsCount(), and SOCKET_.

◆ IsSwitchedOn()

bool IsSwitchedOn ( )
inlineprotected

Energy manager: Returns state of the switch. Whenever the device is working or not does not matter. Use IsWorking() to account for that as well.

Definition at line 897 of file componentenergymanager.c.

References m_IsSwichedOn.

Referenced by CanSwitchOff(), CanSwitchOn(), DeviceUpdate(), FindAndConsumeEnergy(), Entity::GetDebugText(), GetPoweredDevices(), HandleMoveInsideCargo(), and TransferEntityVariables().

◆ IsWorking()

bool IsWorking ( )
inlineprotected

Energy manager: Returns true if this device is working right now.

Definition at line 938 of file componentenergymanager.c.

References m_IsWorking.

Referenced by DeviceUpdate(), Entity::GetDebugText(), and SwitchOff().

◆ OnAttachmentAdded()

void OnAttachmentAdded ( EntityAI elec_device)
inlineprotected

◆ OnAttachmentRemoved()

void OnAttachmentRemoved ( EntityAI elec_device)
inlineprotected

◆ OnDeviceDestroyed()

void OnDeviceDestroyed ( )
inlineprotected

◆ OnEnergyAdded()

void OnEnergyAdded ( )
inlineprotected

Energy manager: Called when energy was added on this device.

Definition at line 1531 of file componentenergymanager.c.

References Component::m_ThisEntityAI, and m_UpdateQuantityTimer.

Referenced by AddEnergy().

◆ OnEnergyConsumed()

void OnEnergyConsumed ( )
inlineprotected

Energy manager: Called when energy was consumed on this device.

Definition at line 1524 of file componentenergymanager.c.

References Component::m_ThisEntityAI.

Referenced by AddEnergy().

◆ OnInteractBranch()

void OnInteractBranch ( EntityAI originalCaller,
Man player,
int system )
inlineprotected

Called when the player is interacting with an item containing this energy component, or when interacting with an item this device is connected to.

Definition at line 1579 of file componentenergymanager.c.

References Component::m_ThisEntityAI.

Referenced by InteractBranch().

◆ OnIsPlugged()

void OnIsPlugged ( EntityAI source_device)
inlineprotected

◆ OnIsUnplugged()

void OnIsUnplugged ( EntityAI last_energy_source)
inlineprotected

Definition at line 1429 of file componentenergymanager.c.

References Component::m_ThisEntityAI, and UpdateCanWork().

◆ OnOwnSocketReleased()

void OnOwnSocketReleased ( EntityAI device)
inlineprotected

Definition at line 1453 of file componentenergymanager.c.

References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.

Referenced by UnplugDevice().

◆ OnOwnSocketTaken()

void OnOwnSocketTaken ( EntityAI device)
inlineprotected

Definition at line 1437 of file componentenergymanager.c.

References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.

Referenced by PlugInDevice().

◆ OnWork()

void OnWork ( float consumed_energy)
inlineprotected

Definition at line 1405 of file componentenergymanager.c.

References Component::m_ThisEntityAI.

Referenced by DeviceUpdate().

◆ PlugCordIntoSocket()

void PlugCordIntoSocket ( EntityAI device_to_plug,
int socket_id = -1 )
inlineprotected

◆ PlugInDevice()

◆ PlugThisInto()

bool PlugThisInto ( EntityAI energy_source,
int socket_id = -1 )
inlineprotected

Energy manager: Attempts to plug this device into the energy_source. Returns true if the action was successfull, or false if not (due to plug incompatibility or no free socket on the receiver). The ID of the power socket is chosen automatically unless optional parameter socket_id is used (starting from 0). If the given ID is not free then a free socket is found.

Definition at line 752 of file componentenergymanager.c.

References Component::m_ThisEntityAI.

Referenced by OnAttachmentAdded().

◆ RefreshDebug()

void RefreshDebug ( )
inlineprotected

Definition at line 346 of file componentenergymanager.c.

References CALL_CATEGORY_SYSTEM, m_DebugPlugArrow, m_DebugPlugs, and m_DebugUpdate.

Referenced by SetDebugPlugs().

◆ RememberLastUpdateTime()

void RememberLastUpdateTime ( )
inlineprotected

Definition at line 1800 of file componentenergymanager.c.

References GetCurrentUpdateTime(), and m_LastUpdateTime.

Referenced by DeviceUpdate().

◆ ResetEnergyUsage()

void ResetEnergyUsage ( )
inlineprotected

Energy manager: Resets energy usage to default (config) value.

Definition at line 672 of file componentenergymanager.c.

References g_Game, m_EnergyUsage, and Component::m_ThisEntityAI.

◆ RestorePlugState()

void RestorePlugState ( bool state)
inlineprotected

Definition at line 528 of file componentenergymanager.c.

References m_RestorePlugState.

◆ SetAttachmentAction()

void SetAttachmentAction ( int new_action_type)
inlineprotected

Definition at line 660 of file componentenergymanager.c.

References m_AttachmentActionType.

◆ SetCordLength()

void SetCordLength ( float new_length)
inlineprotected

Energy manager: Changes the length of the virtual power cord.

Definition at line 648 of file componentenergymanager.c.

References m_CordLength.

◆ SetCordTextureFile()

void SetCordTextureFile ( string new_path)
inlineprotected

Definition at line 682 of file componentenergymanager.c.

References m_CordTextureFile.

◆ SetDebugPlugs()

void SetDebugPlugs ( bool newVal)
inlineprotected

Definition at line 371 of file componentenergymanager.c.

References m_DebugPlugs, and RefreshDebug().

◆ SetDeviceBySocketID()

void SetDeviceBySocketID ( int id,
EntityAI plugged_device )
inlineprotected

Energy manager: Stores the device which is plugged into the given socket ID.

Definition at line 694 of file componentenergymanager.c.

References m_Sockets.

Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().

◆ SetElectricityIconVisibility()

void SetElectricityIconVisibility ( bool make_visible)
inlineprotected

Energy manager: Sets visibility of the electricity icon (bolt).

Definition at line 701 of file componentenergymanager.c.

References m_HasElectricityIcon.

◆ SetEnergy()

void SetEnergy ( float new_energy)
inlineprotected

Energy manager: Sets stored energy for this device. It ignores the min/max limit!

Definition at line 534 of file componentenergymanager.c.

References g_Game, GetEnergyUsage(), m_Energy, Component::m_ThisEntityAI, Math::Min(), and UpdateCanWork().

Referenced by AddEnergy(), SetEnergy0To1(), and TransferEntityVariables().

◆ SetEnergy0To1()

void SetEnergy0To1 ( float energy01)
inlineprotected

Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value between 0 and 1.

Definition at line 550 of file componentenergymanager.c.

References GetEnergyMax(), Math::Lerp(), and SetEnergy().

Referenced by InventoryItem::SetCEBasedQuantity().

◆ SetEnergyMaxPristine()

void SetEnergyMaxPristine ( float new_limit)
inlineprotected

Energy manager: Changes the maximum amount of energy this device can store (when pristine).

Definition at line 642 of file componentenergymanager.c.

References m_EnergyStorageMax.

◆ SetEnergySource()

void SetEnergySource ( EntityAI source)
inlineprotected

◆ SetEnergySourceClient()

void SetEnergySourceClient ( EntityAI source)
inlineprotected

Definition at line 688 of file componentenergymanager.c.

References SetEnergySource().

◆ SetEnergyUsage()

void SetEnergyUsage ( float new_usage)
inlineprotected

Energy manager: Changes the energy usage per second.

Definition at line 666 of file componentenergymanager.c.

References m_EnergyUsage.

◆ SetMySocketID()

void SetMySocketID ( int slot_ID)
inlineprotected

Definition at line 1784 of file componentenergymanager.c.

References m_MySocketID.

◆ SetPassiveState()

void SetPassiveState ( bool state = true)
inlineprotected

Energy manager: Changes the status of this device. When it's passive (true), the main timer and OnWork events are not used.

Definition at line 450 of file componentenergymanager.c.

References DeviceUpdate(), and m_IsPassiveDevice.

◆ SetPlugOwner()

void SetPlugOwner ( string selection_name,
EntityAI device )
inlineprotected

Definition at line 1713 of file componentenergymanager.c.

References m_DeviceByPlugSelection.

Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().

◆ SetPlugType()

void SetPlugType ( int new_type)
inlineprotected

Definition at line 654 of file componentenergymanager.c.

References m_PlugType.

◆ SetPowered()

void SetPowered ( bool state)
inlineprotected

Definition at line 1741 of file componentenergymanager.c.

References m_IsWorking.

Referenced by DeviceUpdate(), and OnDeviceDestroyed().

◆ SetUpdateInterval()

void SetUpdateInterval ( float value)
inlineprotected

Energy manager: Sets the interval of the OnWork(...) calls. Changing this value does not change the rate of energy consumption.

Definition at line 740 of file componentenergymanager.c.

References m_UpdateInterval.

Referenced by Event_OnAwake().

◆ StartUpdates()

void StartUpdates ( )
inlineprotected

◆ StopUpdates()

void StopUpdates ( )
inlineprotected

Definition at line 1549 of file componentenergymanager.c.

References m_UpdateTimer.

Referenced by DeviceUpdate(), and SwitchOff().

◆ StoreEnergySourceIDs()

void StoreEnergySourceIDs ( int b1,
int b2,
int b3,
int b4 )
inlineprotected

◆ SwitchOff()

void SwitchOff ( )
inlineprotected

◆ SwitchOn()

void SwitchOn ( )
inlineprotected

Energy manager: Switches ON the device so it starts doing its work if it has enough energy.

Definition at line 384 of file componentenergymanager.c.

References CanSwitchOn(), DeviceUpdate(), g_Game, m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StartUpdates(), Synch(), UpdateCanWork(), and WakeUpWholeBranch().

Referenced by Event_OnAwake(), and TransferEntityVariables().

◆ Synch()

void Synch ( )
inlineprotected

Definition at line 1789 of file componentenergymanager.c.

References g_Game, and Component::m_ThisEntityAI.

Referenced by SetEnergySource(), SwitchOff(), SwitchOn(), and UpdateCanWork().

◆ UnplugAllDevices()

void UnplugAllDevices ( )
inlineprotected

Energy manager: Unplugs everything directly connected to this device.

Definition at line 515 of file componentenergymanager.c.

References Get(), GetPluggedDevices(), GetPluggedDevicesCount(), and UnplugDevice().

Referenced by OnDeviceDestroyed().

◆ UnplugCordFromSocket()

void UnplugCordFromSocket ( int socket_to_unplug_ID)
inlineprotected

◆ UnplugDevice()

void UnplugDevice ( EntityAI device_to_unplug)
inlineprotected

◆ UnplugThis()

void UnplugThis ( )
inlineprotected

Energy manager: Unplugs this device from its power source.

Definition at line 503 of file componentenergymanager.c.

References g_Game, GetEnergySource(), and Component::m_ThisEntityAI.

Referenced by OnAttachmentRemoved(), OnDeviceDestroyed(), and UpdatePlugState().

◆ UpdateCanWork()

void UpdateCanWork ( )
inlineprotected

◆ UpdatePlugState()

void UpdatePlugState ( )
inlineprotected

Energy manager: Unplugs this device when it's necesarry.

Definition at line 599 of file componentenergymanager.c.

References IsEnergySourceAtReach(), Component::m_ThisEntityAI, and UnplugThis().

◆ UpdateSelections()

void UpdateSelections ( )
inlineprotected

Energy manager: Shows/Hides all selections this system works with. Call this if something is wrong with selections (like during Init and Restore event in config).

Definition at line 556 of file componentenergymanager.c.

References _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), GetEnergySource(), GetSocketsCount(), Component::m_ThisEntityAI, SEL_CORD_FOLDED, SEL_CORD_PLUGGED, SOCKET_, and ToString().

◆ UpdateSocketSelections()

void UpdateSocketSelections ( int socket_id,
EntityAI device_to_plug )
inlineprotected

◆ WakeUpWholeBranch()

void WakeUpWholeBranch ( EntityAI original_caller)
inlineprotected

Definition at line 1587 of file componentenergymanager.c.

References GetPluggedDevices(), and GetSocketsCount().

Referenced by DeviceUpdate(), PlugInDevice(), SwitchOff(), and SwitchOn().

Field Documentation

◆ _AVAILABLE

const string _AVAILABLE = "_available"
staticprotected

◆ _PLUGGED

const string _PLUGGED = "_plugged"
staticprotected

◆ DEFAULT_UPDATE_INTERVAL

const float DEFAULT_UPDATE_INTERVAL = 15
protected

Definition at line 20 of file componentenergymanager.c.

Referenced by Event_OnAwake().

◆ m_AttachmentActionType

int m_AttachmentActionType
protected

◆ m_AutoSwitchOff

bool m_AutoSwitchOff
protected

Definition at line 31 of file componentenergymanager.c.

Referenced by DeviceUpdate(), and Event_OnAwake().

◆ m_AutoSwitchOffWhenInCargo

bool m_AutoSwitchOffWhenInCargo
protected

Definition at line 34 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and HandleMoveInsideCargo().

◆ m_CanStopWork

bool m_CanStopWork
protected

Definition at line 29 of file componentenergymanager.c.

Referenced by DeviceUpdate().

◆ m_CanWork

bool m_CanWork
protected

Definition at line 28 of file componentenergymanager.c.

Referenced by CanWork(), DeviceUpdate(), Event_OnAwake(), and UpdateCanWork().

◆ m_CompatiblePlugTypes

ref TIntArray m_CompatiblePlugTypes
protected

◆ m_ConvertEnergyToQuantity

bool m_ConvertEnergyToQuantity
protected

Definition at line 36 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and HasConversionOfEnergyToQuantity().

◆ m_CordLength

float m_CordLength
protected

Definition at line 54 of file componentenergymanager.c.

Referenced by Event_OnAwake(), GetCordLength(), and SetCordLength().

◆ m_CordTextureFile

string m_CordTextureFile
protected

Definition at line 59 of file componentenergymanager.c.

Referenced by Event_OnAwake(), GetCordTextureFile(), and SetCordTextureFile().

◆ m_DebugPlugArrow

Shape m_DebugPlugArrow
protected

◆ m_DebugPlugs

bool m_DebugPlugs = false
staticprotected

◆ m_DebugUpdate

ref Timer m_DebugUpdate
protected

Definition at line 75 of file componentenergymanager.c.

Referenced by DebugUpdate(), OnIsPlugged(), and RefreshDebug().

◆ m_DeviceByPlugSelection

ref map<string,EntityAI> m_DeviceByPlugSelection
protected

Definition at line 71 of file componentenergymanager.c.

Referenced by Event_OnAwake(), GetPlugOwner(), and SetPlugOwner().

◆ m_Energy

float m_Energy
protected

◆ m_EnergyAtSpawn

float m_EnergyAtSpawn
protected

Definition at line 50 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and GetEnergyAtSpawn().

◆ m_EnergySource

EntityAI m_EnergySource
protected

Definition at line 69 of file componentenergymanager.c.

Referenced by GetEnergySource(), and SetEnergySource().

◆ m_EnergySourceNetworkIDHigh

int m_EnergySourceNetworkIDHigh = -1
protected

Definition at line 46 of file componentenergymanager.c.

Referenced by GetEnergySourceNetworkIDHigh(), and SetEnergySource().

◆ m_EnergySourceNetworkIDLow

int m_EnergySourceNetworkIDLow = -1
protected

Definition at line 45 of file componentenergymanager.c.

Referenced by GetEnergySourceNetworkIDLow(), and SetEnergySource().

◆ m_EnergySourceStorageIDb1

int m_EnergySourceStorageIDb1
protected

Definition at line 40 of file componentenergymanager.c.

Referenced by GetEnergySourceStorageIDb1(), and StoreEnergySourceIDs().

◆ m_EnergySourceStorageIDb2

int m_EnergySourceStorageIDb2
protected

Definition at line 41 of file componentenergymanager.c.

Referenced by GetEnergySourceStorageIDb2(), and StoreEnergySourceIDs().

◆ m_EnergySourceStorageIDb3

int m_EnergySourceStorageIDb3
protected

Definition at line 42 of file componentenergymanager.c.

Referenced by GetEnergySourceStorageIDb3(), and StoreEnergySourceIDs().

◆ m_EnergySourceStorageIDb4

int m_EnergySourceStorageIDb4
protected

Definition at line 43 of file componentenergymanager.c.

Referenced by GetEnergySourceStorageIDb4(), and StoreEnergySourceIDs().

◆ m_EnergyStorageMax

float m_EnergyStorageMax
protected

◆ m_EnergyUsage

float m_EnergyUsage
protected

◆ m_HasElectricityIcon

bool m_HasElectricityIcon
protected

◆ m_IsPassiveDevice

bool m_IsPassiveDevice
protected

◆ m_IsPlugged

bool m_IsPlugged
protected

Definition at line 35 of file componentenergymanager.c.

Referenced by IsPlugged(), and SetEnergySource().

◆ m_IsSwichedOn

bool m_IsSwichedOn
protected

Definition at line 24 of file componentenergymanager.c.

Referenced by IsSwitchedOn(), SwitchOff(), and SwitchOn().

◆ m_IsSwichedOnPreviousState

bool m_IsSwichedOnPreviousState
protected

Definition at line 25 of file componentenergymanager.c.

Referenced by GetPreviousSwitchState(), SwitchOff(), and SwitchOn().

◆ m_IsWorking

bool m_IsWorking
protected

Definition at line 27 of file componentenergymanager.c.

Referenced by IsWorking(), and SetPowered().

◆ m_LastUpdateTime

float m_LastUpdateTime
protected

◆ m_MySocketID

int m_MySocketID = -1
protected

Definition at line 38 of file componentenergymanager.c.

Referenced by GetMySocketID(), and SetMySocketID().

◆ m_PluggedDevices

ref array<EntityAI> m_PluggedDevices
protected

Definition at line 70 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and GetPluggedDevices().

◆ m_PlugType

int m_PlugType
protected

Definition at line 39 of file componentenergymanager.c.

Referenced by Event_OnAwake(), GetPlugType(), and SetPlugType().

◆ m_ReduceMaxEnergyByDamageCoef

float m_ReduceMaxEnergyByDamageCoef
protected

Definition at line 52 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and GetEnergyMax().

◆ m_RestorePlugState

bool m_RestorePlugState
protected

Definition at line 30 of file componentenergymanager.c.

Referenced by GetRestorePlugState(), and RestorePlugState().

◆ m_ShowSocketsInInventory

bool m_ShowSocketsInInventory
protected

Definition at line 32 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and HasVisibleSocketsInInventory().

◆ m_Sockets

EntityAI m_Sockets[MAX_SOCKETS_COUNT]
protected

◆ m_SocketsCount

float m_SocketsCount
protected

Definition at line 53 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and GetSocketsCount().

◆ m_UpdateInterval

float m_UpdateInterval
protected

Definition at line 57 of file componentenergymanager.c.

Referenced by GetUpdateInterval(), and SetUpdateInterval().

◆ m_UpdateQuantityTimer

ref Timer m_UpdateQuantityTimer
protected

Definition at line 74 of file componentenergymanager.c.

Referenced by Event_OnAwake(), and OnEnergyAdded().

◆ m_UpdateTimer

ref Timer m_UpdateTimer
protected

Definition at line 73 of file componentenergymanager.c.

Referenced by StartUpdates(), and StopUpdates().

◆ m_WetnessExposure

float m_WetnessExposure
protected

Definition at line 56 of file componentenergymanager.c.

Referenced by CheckWetness(), Event_OnAwake(), and GetWetnessExposure().

◆ MAX_SOCKETS_COUNT

const int MAX_SOCKETS_COUNT = 4
protected

Definition at line 77 of file componentenergymanager.c.

Referenced by Event_OnAwake().

◆ SEL_CORD_FOLDED

const string SEL_CORD_FOLDED = "cord_folded"
staticprotected

Definition at line 66 of file componentenergymanager.c.

Referenced by PlugInDevice(), UnplugDevice(), and UpdateSelections().

◆ SEL_CORD_PLUGGED

const string SEL_CORD_PLUGGED = "cord_plugged"
staticprotected

◆ SOCKET_

const string SOCKET_ = "socket_"
staticprotected

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