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

Защищенные члены

void ComponentEnergyManager ()
 
void ~ComponentEnergyManager ()
 
override void Event_OnInit ()
 
void DebugUpdate ()
 
Shape DrawArrow (vector from, vector to, float size=0.5, int color=0xFFFFFFFF, float flags=0)
 
EntityAI GetThisEntityAI ()
 
override void Event_OnAwake ()
 
override int GetCompType ()
 
void OnDeviceDestroyed ()
 
void RefreshDebug ()
 
bool GetDebugPlugs ()
 
void SetDebugPlugs (bool newVal)
 
void SwitchOn ()
 Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
 
void SwitchOff ()
 Energy manager: Switches OFF the device.
 
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 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 UnplugAllDevices ()
 Energy manager: Unplugs everything directly connected to this device.
 
void RestorePlugState (bool state)
 
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 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 UpdatePlugState ()
 Energy manager: Unplugs this device when it's necesarry.
 
void GetCompatiblePlugTypes (out TIntArray IDs)
 
void StoreEnergySourceIDs (int b1, int b2, int b3, int b4)
 
void SetEnergyMaxPristine (float new_limit)
 Energy manager: Changes the maximum amount of energy this device can store (when pristine).
 
void SetCordLength (float new_length)
 Energy manager: Changes the length of the virtual power cord.
 
void SetPlugType (int new_type)
 
void SetAttachmentAction (int new_action_type)
 
void SetEnergyUsage (float new_usage)
 Energy manager: Changes the energy usage per second.
 
void ResetEnergyUsage ()
 Energy manager: Resets energy usage to default (config) value.
 
void SetCordTextureFile (string new_path)
 
void SetEnergySourceClient (EntityAI source)
 
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 UpdateCanWork ()
 
void HandleMoveInsideCargo (EntityAI container)
 
void SetUpdateInterval (float value)
 Energy manager: Sets the interval of the OnWork(...) calls. Changing this value does not change the rate of energy consumption.
 
bool GetRestorePlugState ()
 
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.
 
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.
 
bool CanSwitchOff ()
 Energy manager: Checks if the device can be switched OFF.
 
bool GetPreviousSwitchState ()
 
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 IsCordFolded ()
 Energy manager: Returns true if the cord of this device is folded. Returns false if it's plugged.
 
bool IsPassive ()
 Energy manager: Returns true if this device is set to be passive. False if otherwise.
 
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 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.
 
bool IsWorking ()
 Energy manager: Returns true if this device is working right now.
 
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 IsPlugCompatible (int plug_ID)
 Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceivePlugFrom() method.
 
bool CanReceivePlugFrom (EntityAI device_to_plug)
 Energy manager: Returns true if this device can receive power plug of the other device.
 
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 HasElectricityIcon ()
 Energy manager: Returns true if the electricity icon (bolt) is supposed to be visible for this device. False if not.
 
bool HasConversionOfEnergyToQuantity ()
 Energy manager: Returns true if this item automatically converts its energy to quantity.
 
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. Otherwise returns false.
 
bool HasVisibleSocketsInInventory ()
 
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.
 
int GetSocketsCount ()
 Energy manager: Returns the count of power sockets (whenever used or not)
 
int GetPlugType ()
 Energy manager: Returns plug type. Check \DZ\data\basicDefines.hpp OR \Scripts\Classes\Component_constants.h files for types of plugs.
 
int GetAttachmentAction ()
 
int GetEnergySourceStorageIDb1 ()
 
int GetEnergySourceStorageIDb2 ()
 
int GetEnergySourceStorageIDb3 ()
 
int GetEnergySourceStorageIDb4 ()
 
int GetEnergySourceNetworkIDLow ()
 
int GetEnergySourceNetworkIDHigh ()
 
int GetPluggedDevicesCount ()
 Energy manager: Returns the number of devices plugged into this one.
 
int GetEnergy0To100 ()
 Energy manager: Returns % of stored energy this device has as integer (from 0 to 100)
 
float GetEnergy0To1 ()
 Energy manager: Returns % of stored energy this device has as float (from 0.0 to 1.0)
 
float GetUpdateInterval ()
 Energy manager: Returns the update interval of this device.
 
float GetWetnessExposure ()
 Returns wetness exposure value defined in config.
 
float GetEnergyUsage ()
 Energy manager: Returns the number of energy this device needs to run itself (See its config >> energyUsagePerSecond)
 
float GetEnergy ()
 Energy manager: Returns the amount of stored energy this device has.
 
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.
 
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.
 
float GetEnergyAtSpawn ()
 
float GetCordLength ()
 Energy manager: Returns the length of the virtual power cord.
 
EntityAI GetEnergySource ()
 Energy manager: Returns the energy source this device is plugged into.
 
EntityAI GetDeviceBySocketID (int id)
 Energy manager: Returns the device which is plugged into the given socket ID.
 
EntityAI GetPlugOwner (string plug_selection_name)
 Energy manager: Returns the device to which the given plug selection belongs to.
 
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.
 
string GetCordTextureFile ()
 Energy manager: Returns path to the cord texture file.
 
array< EntityAIGetPluggedDevices ()
 Energy manager: Returns an array of devices which are plugged into this one.
 
array< EntityAIGetPoweredDevices ()
 Energy manager: Returns an array of devices which are plugged into this one and are turned on.
 
void OnWork (float consumed_energy)
 
void OnIsPlugged (EntityAI source_device)
 
void OnIsUnplugged (EntityAI last_energy_source)
 
void OnOwnSocketTaken (EntityAI device)
 
void OnOwnSocketReleased (EntityAI device)
 
void OnAttachmentAdded (EntityAI elec_device)
 
void OnAttachmentRemoved (EntityAI elec_device)
 
void StartUpdates ()
 
void OnEnergyConsumed ()
 Energy manager: Called when energy was consumed on this device.
 
void OnEnergyAdded ()
 Energy manager: Called when energy was added on this device.
 
void StopUpdates ()
 
void InteractBranch (EntityAI originalCaller, Man player=null, int system=0)
 
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 WakeUpWholeBranch (EntityAI original_caller)
 
void PlugCordIntoSocket (EntityAI device_to_plug, int socket_id=-1)
 
void UpdateSocketSelections (int socket_id, EntityAI device_to_plug)
 
void SetEnergySource (EntityAI source)
 
bool PlugInDevice (EntityAI device_to_plug, int socket_id=-1)
 
void SetPlugOwner (string selection_name, EntityAI device)
 
void UnplugCordFromSocket (int socket_to_unplug_ID)
 
void SetPowered (bool state)
 
bool FindAndConsumeEnergy (EntityAI original_caller, float amount, bool ignore_switch_state=false)
 
int GetMySocketID ()
 
void SetMySocketID (int slot_ID)
 
void Synch ()
 
void ClearLastUpdateTime ()
 
void RememberLastUpdateTime ()
 
float GetCurrentUpdateTime ()
 
void DeviceUpdate ()
 

Защищенные данные

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

Статические защищенные данные

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

Дополнительные унаследованные члены

- Закрытые члены унаследованные от Component
void Event_OnFrame (IEntity other, float timeSlice)
 
Shape DebugBBoxDraw ()
 
void DebugBBoxSetColor (int color)
 
void DebugBBoxDelete ()
 
Shape DebugDirectionDraw (float distance=1)
 
void DebugDirectionSetColor (int color)
 
void DebugDirectionDelete ()
 
void SetParentEntityAI (EntityAI e)
 
void Event_OnAwake ()
 
void Event_OnInit ()
 
void LogThis (string msg, string fnc_name="n/a")
 
void LogThisWarning (string msg, string fnc_name="n/a")
 
void LogThisError (string msg, string fnc_name="n/a")
 
string GetCompName ()
 
int GetCompType ()
 
void Event_OnItemAttached (EntityAI item, string slot_name)
 
void Event_OnItemDetached (EntityAI item, string slot_name)
 
override Shape DebugBBoxDraw ()
 
override void DebugBBoxSetColor (int color)
 
override void DebugBBoxDelete ()
 
override Shape DebugDirectionDraw (float distance=1)
 
override void DebugDirectionDelete ()
 
void OnDrawing ()
 
- Закрытые статические члены унаследованные от Component
static void Init ()
 
static string GetNameByType (int comp_type)
 
static bool IsTypeExist (int comp_type)
 
static void LogErrorBadCompType (int comp_type, string fnc_name)
 
static void LogWarningAlredyExist (int comp_type, string fnc_name)
 
- Закрытые данные унаследованные от Component
EntityAI m_ThisEntityAI
 
Shape m_DebugShapeBBox
 
Shape m_DebugShapeDirection
 
float m_DebugShapeDirectionDist
 

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

См. определение в файле ComponentEnergyManager.c строка 18