![]() |
Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
|
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< EntityAI > | GetPluggedDevices () |
| 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< EntityAI > | GetPoweredDevices () |
| 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) |
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_" |
Definition at line 18 of file componentenergymanager.c.
|
inlineprotected |
Definition at line 83 of file componentenergymanager.c.
References m_DebugPlugs.
|
inlineprotected |
Definition at line 91 of file componentenergymanager.c.
References m_DebugPlugArrow.
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().
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.
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().
|
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().
|
inlineprotected |
Energy manager: Checks if the device can be switched ON.
Definition at line 765 of file componentenergymanager.c.
References IsSwitchedOn().
Referenced by SwitchOn().
Energy manager: Checks whenever this device can do work or not.
| test_energy | float optional parameter will overwite the default energy consumption value of this device. |
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().
|
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().
|
inlineprotected |
Definition at line 1795 of file componentenergymanager.c.
References m_LastUpdateTime.
Referenced by DeviceUpdate().
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().
|
inlineprotected |
Definition at line 111 of file componentenergymanager.c.
References vector::DistanceSq(), DrawArrow(), g_Game, GetDebugPlugs(), GetEnergySource(), m_DebugPlugArrow, m_DebugUpdate, and Component::m_ThisEntityAI.
|
inlineprotected |
Definition at line 1811 of file componentenergymanager.c.
References CheckWetness(), ClearLastUpdateTime(), ConsumeEnergy(), g_Game, GetCurrentUpdateTime(), GetEnergyUsage(), IsSwitchedOn(), IsWorking(), m_AutoSwitchOff, m_CanStopWork, m_CanWork, m_IsPassiveDevice, m_LastUpdateTime, Component::m_ThisEntityAI, OnWork(), RememberLastUpdateTime(), SetPowered(), StopUpdates(), SwitchOff(), UpdateCanWork(), and WakeUpWholeBranch().
Referenced by SetPassiveState(), SwitchOff(), and SwitchOn().
|
inlineprotected |
Definition at line 153 of file componentenergymanager.c.
References vector::Normalize(), vector::Perpend(), and Shape.
Referenced by DebugUpdate().
|
inlineprotected |
Definition at line 178 of file componentenergymanager.c.
References _PLUGGED, CALL_CATEGORY_SYSTEM, DEFAULT_UPDATE_INTERVAL, DPrint(), Error(), g_Game, GetSocketsCount(), HasEnoughStoredEnergy(), IsPlugCompatible(), m_AttachmentActionType, m_AutoSwitchOff, m_AutoSwitchOffWhenInCargo, m_CanWork, m_CompatiblePlugTypes, m_ConvertEnergyToQuantity, m_CordLength, m_CordTextureFile, m_DeviceByPlugSelection, m_Energy, m_EnergyAtSpawn, m_EnergyStorageMax, m_EnergyUsage, m_HasElectricityIcon, m_IsPassiveDevice, m_PluggedDevices, m_PlugType, m_ReduceMaxEnergyByDamageCoef, m_ShowSocketsInInventory, m_Sockets, m_SocketsCount, Component::m_ThisEntityAI, m_UpdateQuantityTimer, m_WetnessExposure, MAX_SOCKETS_COUNT, PLUG_COMMON_APPLIANCE, SEL_CORD_PLUGGED, SetUpdateInterval(), SOCKET_, and SwitchOn().
|
inlineprotected |
Definition at line 101 of file componentenergymanager.c.
References g_Game, and Component::m_ThisEntityAI.
|
inlineprotected |
Definition at line 1747 of file componentenergymanager.c.
References AddEnergy(), GetEnergySource(), IsPlugged(), IsSwitchedOn(), and Component::m_ThisEntityAI.
Referenced by ConsumeEnergy().
|
inlineprotected |
Definition at line 1159 of file componentenergymanager.c.
References m_AttachmentActionType.
Referenced by OnAttachmentAdded(), and OnAttachmentRemoved().
|
inlineprotected |
Definition at line 627 of file componentenergymanager.c.
References m_CompatiblePlugTypes.
|
inlineprotected |
Definition at line 322 of file componentenergymanager.c.
References COMP_TYPE_ENERGY_MANAGER.
|
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().
|
inlineprotected |
Energy manager: Returns path to the cord texture file.
Definition at line 1371 of file componentenergymanager.c.
References m_CordTextureFile.
|
inlineprotected |
Definition at line 1805 of file componentenergymanager.c.
References g_Game.
Referenced by DeviceUpdate(), and RememberLastUpdateTime().
|
inlineprotected |
Definition at line 366 of file componentenergymanager.c.
References m_DebugPlugs.
Referenced by DebugUpdate().
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().
|
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().
|
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.
|
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().
|
inlineprotected |
Definition at line 1325 of file componentenergymanager.c.
References m_EnergyAtSpawn.
Referenced by InventoryItem::SetCEBasedQuantity().
|
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().
|
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().
|
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().
|
inlineprotected |
Definition at line 1195 of file componentenergymanager.c.
References m_EnergySourceNetworkIDHigh.
|
inlineprotected |
Definition at line 1189 of file componentenergymanager.c.
References m_EnergySourceNetworkIDLow.
|
inlineprotected |
Definition at line 1165 of file componentenergymanager.c.
References m_EnergySourceStorageIDb1.
|
inlineprotected |
Definition at line 1171 of file componentenergymanager.c.
References m_EnergySourceStorageIDb2.
|
inlineprotected |
Definition at line 1177 of file componentenergymanager.c.
References m_EnergySourceStorageIDb3.
|
inlineprotected |
Definition at line 1183 of file componentenergymanager.c.
References m_EnergySourceStorageIDb4.
|
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().
|
inlineprotected |
Definition at line 1778 of file componentenergymanager.c.
References m_MySocketID.
|
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().
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().
|
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().
Energy manager: Returns the device to which the given plug selection belongs to.
Definition at line 1349 of file componentenergymanager.c.
References m_DeviceByPlugSelection.
|
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.
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().
|
inlineprotected |
Definition at line 891 of file componentenergymanager.c.
References m_IsSwichedOnPreviousState.
|
inlineprotected |
Definition at line 746 of file componentenergymanager.c.
References m_RestorePlugState.
|
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().
|
inlineprotected |
Definition at line 172 of file componentenergymanager.c.
References Component::m_ThisEntityAI.
|
inlineprotected |
Energy manager: Returns the update interval of this device.
Definition at line 1235 of file componentenergymanager.c.
References m_UpdateInterval.
Referenced by StartUpdates().
|
inlineprotected |
Returns wetness exposure value defined in config.
Definition at line 1247 of file componentenergymanager.c.
References m_WetnessExposure.
|
inlineprotected |
Definition at line 728 of file componentenergymanager.c.
References IsSwitchedOn(), m_AutoSwitchOffWhenInCargo, and SwitchOff().
|
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.
|
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.
|
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().
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().
|
inlineprotected |
Definition at line 1117 of file componentenergymanager.c.
References m_ShowSocketsInInventory.
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().
|
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().
|
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.
| from_position | vector position from where the measurement will be taken |
| add_tolerance | float parameter will add to the cord's length in meters (optional) |
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. Definition at line 1076 of file componentenergymanager.c.
References vector::Distance(), GetCordLength(), GetEnergySource(), and IsPlugged().
Referenced by Hologram::CorrectMaterialPathName(), and UpdatePlugState().
|
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().
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().
|
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().
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_.
|
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().
|
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().
|
inlineprotected |
Definition at line 1470 of file componentenergymanager.c.
References GetAttachmentAction(), Component::m_ThisEntityAI, PLUG_ATTACHMENTS_INTO_THIS, PLUG_THIS_INTO_ATTACHMENT, and PlugThisInto().
|
inlineprotected |
Definition at line 1491 of file componentenergymanager.c.
References GetAttachmentAction(), GetEnergySource(), PLUG_ATTACHMENTS_INTO_THIS, PLUG_THIS_INTO_ATTACHMENT, and UnplugThis().
|
inlineprotected |
Definition at line 328 of file componentenergymanager.c.
References Component::m_ThisEntityAI, SetPowered(), SwitchOff(), UnplugAllDevices(), and UnplugThis().
|
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().
|
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().
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().
|
inlineprotected |
Definition at line 1412 of file componentenergymanager.c.
References CALL_CATEGORY_SYSTEM, m_DebugPlugs, m_DebugUpdate, Component::m_ThisEntityAI, and UpdateCanWork().
|
inlineprotected |
Definition at line 1429 of file componentenergymanager.c.
References Component::m_ThisEntityAI, and UpdateCanWork().
|
inlineprotected |
Definition at line 1453 of file componentenergymanager.c.
References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.
Referenced by UnplugDevice().
|
inlineprotected |
Definition at line 1437 of file componentenergymanager.c.
References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.
Referenced by PlugInDevice().
|
inlineprotected |
Definition at line 1405 of file componentenergymanager.c.
References Component::m_ThisEntityAI.
Referenced by DeviceUpdate().
Definition at line 1610 of file componentenergymanager.c.
References GetDeviceBySocketID(), GetSocketsCount(), and UpdateSocketSelections().
Referenced by PlugInDevice().
Definition at line 1682 of file componentenergymanager.c.
References CanReceivePlugFrom(), g_Game, GetPluggedDevices(), InteractBranch(), Component::m_ThisEntityAI, OnOwnSocketTaken(), PlugCordIntoSocket(), SEL_CORD_FOLDED, SEL_CORD_PLUGGED, and WakeUpWholeBranch().
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().
|
inlineprotected |
Definition at line 346 of file componentenergymanager.c.
References CALL_CATEGORY_SYSTEM, m_DebugPlugArrow, m_DebugPlugs, and m_DebugUpdate.
Referenced by SetDebugPlugs().
|
inlineprotected |
Definition at line 1800 of file componentenergymanager.c.
References GetCurrentUpdateTime(), and m_LastUpdateTime.
Referenced by DeviceUpdate().
|
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.
|
inlineprotected |
Definition at line 528 of file componentenergymanager.c.
References m_RestorePlugState.
|
inlineprotected |
Definition at line 660 of file componentenergymanager.c.
References m_AttachmentActionType.
|
inlineprotected |
Energy manager: Changes the length of the virtual power cord.
Definition at line 648 of file componentenergymanager.c.
References m_CordLength.
|
inlineprotected |
Definition at line 682 of file componentenergymanager.c.
References m_CordTextureFile.
|
inlineprotected |
Definition at line 371 of file componentenergymanager.c.
References m_DebugPlugs, and RefreshDebug().
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().
|
inlineprotected |
Energy manager: Sets visibility of the electricity icon (bolt).
Definition at line 701 of file componentenergymanager.c.
References m_HasElectricityIcon.
|
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().
|
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().
|
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.
|
inlineprotected |
Definition at line 1659 of file componentenergymanager.c.
References m_EnergySource, m_EnergySourceNetworkIDHigh, m_EnergySourceNetworkIDLow, m_IsPlugged, StartUpdates(), and Synch().
Referenced by SetEnergySourceClient().
|
inlineprotected |
Definition at line 688 of file componentenergymanager.c.
References SetEnergySource().
|
inlineprotected |
Energy manager: Changes the energy usage per second.
Definition at line 666 of file componentenergymanager.c.
References m_EnergyUsage.
|
inlineprotected |
Definition at line 1784 of file componentenergymanager.c.
References m_MySocketID.
|
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.
Definition at line 1713 of file componentenergymanager.c.
References m_DeviceByPlugSelection.
Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().
|
inlineprotected |
Definition at line 654 of file componentenergymanager.c.
References m_PlugType.
|
inlineprotected |
Definition at line 1741 of file componentenergymanager.c.
References m_IsWorking.
Referenced by DeviceUpdate(), and OnDeviceDestroyed().
|
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().
|
inlineprotected |
Definition at line 1509 of file componentenergymanager.c.
References CALL_CATEGORY_SYSTEM, GetUpdateInterval(), m_IsPassiveDevice, and m_UpdateTimer.
Referenced by AddEnergy(), SetEnergySource(), and SwitchOn().
|
inlineprotected |
Definition at line 1549 of file componentenergymanager.c.
References m_UpdateTimer.
Referenced by DeviceUpdate(), and SwitchOff().
Definition at line 633 of file componentenergymanager.c.
References m_EnergySourceStorageIDb1, m_EnergySourceStorageIDb2, m_EnergySourceStorageIDb3, and m_EnergySourceStorageIDb4.
|
inlineprotected |
Energy manager: Switches OFF the device.
Definition at line 415 of file componentenergymanager.c.
References CanSwitchOff(), DeviceUpdate(), g_Game, IsWorking(), m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StopUpdates(), Synch(), UpdateCanWork(), and WakeUpWholeBranch().
Referenced by DeviceUpdate(), HandleMoveInsideCargo(), and OnDeviceDestroyed().
|
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().
|
inlineprotected |
Definition at line 1789 of file componentenergymanager.c.
References g_Game, and Component::m_ThisEntityAI.
Referenced by SetEnergySource(), SwitchOff(), SwitchOn(), and UpdateCanWork().
|
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().
|
inlineprotected |
Definition at line 1723 of file componentenergymanager.c.
References _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), Component::m_ThisEntityAI, SetDeviceBySocketID(), SetPlugOwner(), SOCKET_, and ToString().
Referenced by UnplugDevice().
|
inlineprotected |
Energy manager: Unplugs the given device from this one.
Definition at line 460 of file componentenergymanager.c.
References g_Game, GetPluggedDevices(), GetPluggedDevicesCount(), m_DebugPlugArrow, m_DebugPlugs, Component::m_ThisEntityAI, OnOwnSocketReleased(), SEL_CORD_FOLDED, SEL_CORD_PLUGGED, and UnplugCordFromSocket().
Referenced by UnplugAllDevices().
|
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().
|
inlineprotected |
Definition at line 707 of file componentenergymanager.c.
References CanWork(), g_Game, m_CanWork, Component::m_ThisEntityAI, and Synch().
Referenced by DeviceUpdate(), OnIsPlugged(), OnIsUnplugged(), SetEnergy(), SwitchOff(), and SwitchOn().
|
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().
|
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().
Definition at line 1638 of file componentenergymanager.c.
References _AVAILABLE, _PLUGGED, Component::m_ThisEntityAI, SetDeviceBySocketID(), SetPlugOwner(), SOCKET_, and ToString().
Referenced by PlugCordIntoSocket().
|
inlineprotected |
Definition at line 1587 of file componentenergymanager.c.
References GetPluggedDevices(), and GetSocketsCount().
Referenced by DeviceUpdate(), PlugInDevice(), SwitchOff(), and SwitchOn().
|
staticprotected |
Definition at line 64 of file componentenergymanager.c.
Referenced by UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().
|
staticprotected |
Definition at line 63 of file componentenergymanager.c.
Referenced by Event_OnAwake(), IsSelectionAPlug(), UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().
|
protected |
Definition at line 20 of file componentenergymanager.c.
Referenced by Event_OnAwake().
|
protected |
Definition at line 44 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetAttachmentAction(), and SetAttachmentAction().
|
protected |
Definition at line 31 of file componentenergymanager.c.
Referenced by DeviceUpdate(), and Event_OnAwake().
|
protected |
Definition at line 34 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and HandleMoveInsideCargo().
|
protected |
Definition at line 29 of file componentenergymanager.c.
Referenced by DeviceUpdate().
|
protected |
Definition at line 28 of file componentenergymanager.c.
Referenced by CanWork(), DeviceUpdate(), Event_OnAwake(), and UpdateCanWork().
|
protected |
Definition at line 68 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetCompatiblePlugTypes(), and IsPlugCompatible().
|
protected |
Definition at line 36 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and HasConversionOfEnergyToQuantity().
|
protected |
Definition at line 54 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetCordLength(), and SetCordLength().
|
protected |
Definition at line 59 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetCordTextureFile(), and SetCordTextureFile().
|
protected |
Definition at line 22 of file componentenergymanager.c.
Referenced by ~ComponentEnergyManager(), DebugUpdate(), RefreshDebug(), and UnplugDevice().
|
staticprotected |
Definition at line 21 of file componentenergymanager.c.
Referenced by ComponentEnergyManager(), GetDebugPlugs(), OnIsPlugged(), RefreshDebug(), SetDebugPlugs(), and UnplugDevice().
|
protected |
Definition at line 75 of file componentenergymanager.c.
Referenced by DebugUpdate(), OnIsPlugged(), and RefreshDebug().
Definition at line 71 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetPlugOwner(), and SetPlugOwner().
|
protected |
Definition at line 49 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetEnergy(), GetEnergy0To1(), GetEnergy0To100(), and SetEnergy().
|
protected |
Definition at line 50 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and GetEnergyAtSpawn().
|
protected |
Definition at line 69 of file componentenergymanager.c.
Referenced by GetEnergySource(), and SetEnergySource().
|
protected |
Definition at line 46 of file componentenergymanager.c.
Referenced by GetEnergySourceNetworkIDHigh(), and SetEnergySource().
|
protected |
Definition at line 45 of file componentenergymanager.c.
Referenced by GetEnergySourceNetworkIDLow(), and SetEnergySource().
|
protected |
Definition at line 40 of file componentenergymanager.c.
Referenced by GetEnergySourceStorageIDb1(), and StoreEnergySourceIDs().
|
protected |
Definition at line 41 of file componentenergymanager.c.
Referenced by GetEnergySourceStorageIDb2(), and StoreEnergySourceIDs().
|
protected |
Definition at line 42 of file componentenergymanager.c.
Referenced by GetEnergySourceStorageIDb3(), and StoreEnergySourceIDs().
|
protected |
Definition at line 43 of file componentenergymanager.c.
Referenced by GetEnergySourceStorageIDb4(), and StoreEnergySourceIDs().
|
protected |
Definition at line 51 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetEnergy0To1(), GetEnergy0To100(), GetEnergyMaxPristine(), and SetEnergyMaxPristine().
|
protected |
Definition at line 48 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetEnergyUsage(), ResetEnergyUsage(), and SetEnergyUsage().
|
protected |
Definition at line 33 of file componentenergymanager.c.
Referenced by Event_OnAwake(), HasElectricityIcon(), and SetElectricityIconVisibility().
|
protected |
Definition at line 26 of file componentenergymanager.c.
Referenced by DeviceUpdate(), Event_OnAwake(), IsPassive(), SetPassiveState(), and StartUpdates().
|
protected |
Definition at line 35 of file componentenergymanager.c.
Referenced by IsPlugged(), and SetEnergySource().
|
protected |
Definition at line 24 of file componentenergymanager.c.
Referenced by IsSwitchedOn(), SwitchOff(), and SwitchOn().
|
protected |
Definition at line 25 of file componentenergymanager.c.
Referenced by GetPreviousSwitchState(), SwitchOff(), and SwitchOn().
|
protected |
Definition at line 27 of file componentenergymanager.c.
Referenced by IsWorking(), and SetPowered().
|
protected |
Definition at line 55 of file componentenergymanager.c.
Referenced by ClearLastUpdateTime(), DeviceUpdate(), and RememberLastUpdateTime().
|
protected |
Definition at line 38 of file componentenergymanager.c.
Referenced by GetMySocketID(), and SetMySocketID().
Definition at line 70 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and GetPluggedDevices().
|
protected |
Definition at line 39 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetPlugType(), and SetPlugType().
|
protected |
Definition at line 52 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and GetEnergyMax().
|
protected |
Definition at line 30 of file componentenergymanager.c.
Referenced by GetRestorePlugState(), and RestorePlugState().
|
protected |
Definition at line 32 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and HasVisibleSocketsInInventory().
|
protected |
Definition at line 78 of file componentenergymanager.c.
Referenced by Event_OnAwake(), GetDeviceBySocketID(), and SetDeviceBySocketID().
|
protected |
Definition at line 53 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and GetSocketsCount().
|
protected |
Definition at line 57 of file componentenergymanager.c.
Referenced by GetUpdateInterval(), and SetUpdateInterval().
|
protected |
Definition at line 74 of file componentenergymanager.c.
Referenced by Event_OnAwake(), and OnEnergyAdded().
|
protected |
Definition at line 73 of file componentenergymanager.c.
Referenced by StartUpdates(), and StopUpdates().
|
protected |
Definition at line 56 of file componentenergymanager.c.
Referenced by CheckWetness(), Event_OnAwake(), and GetWetnessExposure().
|
protected |
Definition at line 77 of file componentenergymanager.c.
Referenced by Event_OnAwake().
|
staticprotected |
Definition at line 66 of file componentenergymanager.c.
Referenced by PlugInDevice(), UnplugDevice(), and UpdateSelections().
|
staticprotected |
Definition at line 65 of file componentenergymanager.c.
Referenced by ActionUnplugThisByCord::ActionCondition(), Event_OnAwake(), PlugInDevice(), UnplugDevice(), and UpdateSelections().
|
staticprotected |
Definition at line 62 of file componentenergymanager.c.
Referenced by Event_OnAwake(), IsSelectionAPlug(), UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().