DayZ 1.24
|
Protected Member Functions | |
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< EntityAI > | GetPluggedDevices () |
Energy manager: Returns an array of devices which are plugged into this one. | |
array< EntityAI > | GetPoweredDevices () |
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 () |
Static Protected Attributes | |
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" |
Definition at line 18 of file ComponentEnergyManager.c.
|
inlineprotected |
Definition at line 82 of file ComponentEnergyManager.c.
References m_DebugPlugs.
|
inlineprotected |
Definition at line 90 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 1150 of file ComponentEnergyManager.c.
References Math::Clamp(), GetEnergy(), GetEnergyMax(), OnEnergyAdded(), OnEnergyConsumed(), SetEnergy(), and StartUpdates().
Referenced by FindAndConsumeEnergy().
Energy manager: Returns true if this device can be plugged into the given energy source. Otherwise returns false.
Definition at line 944 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 924 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 809 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 715 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 729 of file ComponentEnergyManager.c.
References CheckWetness(), DPrint(), GetEnergy(), GetEnergySource(), GetEnergyUsage(), GetGame(), 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 803 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI, and m_WetnessExposure.
Referenced by CanWork(), and DeviceUpdate().
|
inlineprotected |
Definition at line 1635 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 852 of file ComponentEnergyManager.c.
References FindAndConsumeEnergy(), and Component::m_ThisEntityAI.
Referenced by DeviceUpdate().
|
inlineprotected |
Definition at line 107 of file ComponentEnergyManager.c.
References vector::DistanceSq(), DrawArrow(), GetDebugPlugs(), GetEnergySource(), GetGame(), m_DebugPlugArrow, m_DebugUpdate, and Component::m_ThisEntityAI.
|
inlineprotected |
Definition at line 1651 of file ComponentEnergyManager.c.
References CheckWetness(), ClearLastUpdateTime(), ConsumeEnergy(), GetCurrentUpdateTime(), GetEnergyUsage(), GetGame(), 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 Entity::OnVariablesSynchronized(), SetPassiveState(), SwitchOff(), and SwitchOn().
|
inlineprotected |
Definition at line 147 of file ComponentEnergyManager.c.
References vector::Normalize(), vector::Perpend(), and Shape.
Referenced by DebugUpdate().
Definition at line 172 of file ComponentEnergyManager.c.
References _PLUGGED, CALL_CATEGORY_SYSTEM, DEFAULT_UPDATE_INTERVAL, DPrint(), Error(), GetGame(), 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().
Definition at line 100 of file ComponentEnergyManager.c.
References GetGame(), and Component::m_ThisEntityAI.
|
inlineprotected |
Definition at line 1594 of file ComponentEnergyManager.c.
References AddEnergy(), GetEnergySource(), IsPlugged(), IsSwitchedOn(), and Component::m_ThisEntityAI.
Referenced by ConsumeEnergy().
|
inlineprotected |
Definition at line 1048 of file ComponentEnergyManager.c.
References m_AttachmentActionType.
Referenced by OnAttachmentAdded(), and OnAttachmentRemoved().
Definition at line 593 of file ComponentEnergyManager.c.
References m_CompatiblePlugTypes.
Definition at line 304 of file ComponentEnergyManager.c.
References COMP_TYPE_ENERGY_MANAGER.
|
inlineprotected |
Energy manager: Returns the length of the virtual power cord.
Definition at line 1216 of file ComponentEnergyManager.c.
References m_CordLength.
Referenced by IsEnergySourceAtReach().
|
inlineprotected |
Energy manager: Returns path to the cord texture file.
Definition at line 1252 of file ComponentEnergyManager.c.
References m_CordTextureFile.
|
inlineprotected |
Definition at line 1645 of file ComponentEnergyManager.c.
References GetGame().
Referenced by DeviceUpdate(), and RememberLastUpdateTime().
|
inlineprotected |
Definition at line 345 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 1228 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 1144 of file ComponentEnergyManager.c.
References m_Energy.
Referenced by AddEnergy(), CanWork(), HasEnoughStoredEnergy(), and Entity::OnStoreSave().
|
inlineprotected |
Energy manager: Returns % of stored energy this device has as float (from 0.0 to 1.0)
Definition at line 1111 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 1099 of file ComponentEnergyManager.c.
References m_Energy, m_EnergyStorageMax, and Math::Round().
|
inlineprotected |
Definition at line 1210 of file ComponentEnergyManager.c.
References m_EnergyAtSpawn.
|
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 1182 of file ComponentEnergyManager.c.
References GetEnergyMaxPristine(), GetGame(), 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 1205 of file ComponentEnergyManager.c.
References m_EnergyStorageMax.
Referenced by GetEnergyMax().
|
inlineprotected |
Energy manager: Returns the energy source this device is plugged into.
Definition at line 1222 of file ComponentEnergyManager.c.
References m_EnergySource.
Referenced by CanWork(), DebugUpdate(), FindAndConsumeEnergy(), IsEnergySourceAtReach(), OnAttachmentRemoved(), Entity::OnStoreSave(), UnplugThis(), and UpdateSelections().
|
inlineprotected |
Definition at line 1084 of file ComponentEnergyManager.c.
References m_EnergySourceNetworkIDHigh.
Referenced by Entity::OnVariablesSynchronized().
|
inlineprotected |
Definition at line 1078 of file ComponentEnergyManager.c.
References m_EnergySourceNetworkIDLow.
Referenced by Entity::OnVariablesSynchronized().
|
inlineprotected |
Definition at line 1054 of file ComponentEnergyManager.c.
References m_EnergySourceStorageIDb1.
Referenced by Entity::EEOnAfterLoad().
|
inlineprotected |
Definition at line 1060 of file ComponentEnergyManager.c.
References m_EnergySourceStorageIDb2.
Referenced by Entity::EEOnAfterLoad().
|
inlineprotected |
Definition at line 1066 of file ComponentEnergyManager.c.
References m_EnergySourceStorageIDb3.
Referenced by Entity::EEOnAfterLoad().
|
inlineprotected |
Definition at line 1072 of file ComponentEnergyManager.c.
References m_EnergySourceStorageIDb4.
Referenced by Entity::EEOnAfterLoad().
|
inlineprotected |
Energy manager: Returns the number of energy this device needs to run itself (See its config >> energyUsagePerSecond)
Definition at line 1138 of file ComponentEnergyManager.c.
References m_EnergyUsage.
Referenced by CanWork(), DeviceUpdate(), HasEnoughStoredEnergy(), and SetEnergy().
|
inlineprotected |
|
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 1243 of file ComponentEnergyManager.c.
References GetPluggedDevices(), and GetPluggedDevicesCount().
Energy manager: Returns an array of devices which are plugged into this one.
Definition at line 1258 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 1090 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 1234 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 1042 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 1264 of file ComponentEnergyManager.c.
References GetPluggedDevices(), GetPluggedDevicesCount(), and IsSwitchedOn().
|
inlineprotected |
Definition at line 818 of file ComponentEnergyManager.c.
References m_IsSwichedOnPreviousState.
Referenced by Entity::OnVariablesSynchronized().
|
inlineprotected |
Definition at line 703 of file ComponentEnergyManager.c.
References m_RestorePlugState.
Referenced by Entity::EEOnAfterLoad().
|
inlineprotected |
Energy manager: Returns the count of power sockets (whenever used or not)
Definition at line 1036 of file ComponentEnergyManager.c.
References m_SocketsCount.
Referenced by Event_OnAwake(), HasFreeSocket(), InteractBranch(), IsSelectionAPlug(), PlugCordIntoSocket(), UpdateSelections(), and WakeUpWholeBranch().
|
inlineprotected |
Definition at line 166 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI.
|
inlineprotected |
Energy manager: Returns the update interval of this device.
Definition at line 1120 of file ComponentEnergyManager.c.
References m_UpdateInterval.
Referenced by StartUpdates().
|
inlineprotected |
Returns wetness exposure value defined in config.
Definition at line 1132 of file ComponentEnergyManager.c.
References m_WetnessExposure.
Definition at line 687 of file ComponentEnergyManager.c.
References IsSwitchedOn(), m_AutoSwitchOffWhenInCargo, and SwitchOff().
Referenced by Entity::OnMovedInsideCargo().
|
inlineprotected |
Energy manager: Returns true if this item automatically converts its energy to quantity.
Definition at line 956 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 950 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 864 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 873 of file ComponentEnergyManager.c.
References GetDeviceBySocketID(), GetPluggedDevicesCount(), and GetSocketsCount().
Referenced by CanReceivePlugFrom().
|
inlineprotected |
Definition at line 1010 of file ComponentEnergyManager.c.
References m_ShowSocketsInInventory.
|
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 1416 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 830 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 977 of file ComponentEnergyManager.c.
References vector::Distance(), GetCordLength(), GetEnergySource(), and IsPlugged().
Referenced by UpdatePlugState().
|
inlineprotected |
Energy manager: Returns true if this device is set to be passive. False if otherwise.
Definition at line 839 of file ComponentEnergyManager.c.
References m_IsPassiveDevice.
Referenced by CanSwitchOff(), and Entity::OnStoreSave().
Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceivePlugFrom() method.
Definition at line 897 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 845 of file ComponentEnergyManager.c.
References m_IsPlugged.
Referenced by FindAndConsumeEnergy(), IsCordFolded(), IsEnergySourceAtReach(), and Entity::OnStoreSave().
Energy manager: Returns true if this selection is a plug that's plugged into this device. Otherwise returns false.
Definition at line 1016 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 824 of file ComponentEnergyManager.c.
References m_IsSwichedOn.
Referenced by CanSwitchOff(), CanSwitchOn(), DeviceUpdate(), FindAndConsumeEnergy(), GetPoweredDevices(), HandleMoveInsideCargo(), Entity::OnStoreSave(), and Entity::OnVariablesSynchronized().
|
inlineprotected |
Energy manager: Returns true if this device is working right now.
Definition at line 858 of file ComponentEnergyManager.c.
References m_IsWorking.
Referenced by DeviceUpdate(), Entity::IsIgnited(), and SwitchOff().
Definition at line 1340 of file ComponentEnergyManager.c.
References GetAttachmentAction(), Component::m_ThisEntityAI, PLUG_ATTACHMENTS_INTO_THIS, PLUG_THIS_INTO_ATTACHMENT, and PlugThisInto().
Referenced by Entity::EEItemAttached().
Definition at line 1354 of file ComponentEnergyManager.c.
References GetAttachmentAction(), GetEnergySource(), PLUG_ATTACHMENTS_INTO_THIS, PLUG_THIS_INTO_ATTACHMENT, and UnplugThis().
Referenced by Entity::EEItemDetached().
|
inlineprotected |
Definition at line 310 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI, SetPowered(), SwitchOff(), UnplugAllDevices(), and UnplugThis().
Referenced by Entity::EEDelete().
|
inlineprotected |
Energy manager: Called when energy was added on this device.
Definition at line 1387 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 1381 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI.
Referenced by AddEnergy().
|
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 1432 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI.
Referenced by InteractBranch().
Definition at line 1290 of file ComponentEnergyManager.c.
References CALL_CATEGORY_SYSTEM, m_DebugPlugs, m_DebugUpdate, Component::m_ThisEntityAI, and UpdateCanWork().
Definition at line 1306 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI, and UpdateCanWork().
Definition at line 1326 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.
Referenced by UnplugDevice().
Definition at line 1313 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.
Referenced by PlugInDevice().
Definition at line 1284 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI.
Referenced by DeviceUpdate().
|
inlineprotected |
Definition at line 1462 of file ComponentEnergyManager.c.
References GetDeviceBySocketID(), GetSocketsCount(), and UpdateSocketSelections().
Referenced by PlugInDevice().
|
inlineprotected |
Definition at line 1531 of file ComponentEnergyManager.c.
References CanReceivePlugFrom(), GetGame(), GetPluggedDevices(), InteractBranch(), Component::m_ThisEntityAI, OnOwnSocketTaken(), PlugCordIntoSocket(), SEL_CORD_FOLDED, SEL_CORD_PLUGGED, and WakeUpWholeBranch().
|
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 709 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI.
Referenced by Entity::EEOnAfterLoad(), OnAttachmentAdded(), and Entity::OnVariablesSynchronized().
|
inlineprotected |
Definition at line 325 of file ComponentEnergyManager.c.
References CALL_CATEGORY_SYSTEM, m_DebugPlugArrow, m_DebugPlugs, and m_DebugUpdate.
Referenced by SetDebugPlugs().
|
inlineprotected |
Definition at line 1640 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 638 of file ComponentEnergyManager.c.
References GetGame(), m_EnergyUsage, and Component::m_ThisEntityAI.
Definition at line 499 of file ComponentEnergyManager.c.
References m_RestorePlugState.
Referenced by Entity::OnStoreLoad().
Definition at line 626 of file ComponentEnergyManager.c.
References m_AttachmentActionType.
Energy manager: Changes the length of the virtual power cord.
Definition at line 614 of file ComponentEnergyManager.c.
References m_CordLength.
Definition at line 645 of file ComponentEnergyManager.c.
References m_CordTextureFile.
Definition at line 350 of file ComponentEnergyManager.c.
References m_DebugPlugs, and RefreshDebug().
|
inlineprotected |
Energy manager: Stores the device which is plugged into the given socket ID.
Definition at line 657 of file ComponentEnergyManager.c.
References m_Sockets.
Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().
Energy manager: Sets visibility of the electricity icon (bolt).
Definition at line 664 of file ComponentEnergyManager.c.
References m_HasElectricityIcon.
Energy manager: Sets stored energy for this device. It ignores the min/max limit!
Definition at line 505 of file ComponentEnergyManager.c.
References GetEnergyUsage(), GetGame(), m_Energy, Component::m_ThisEntityAI, Math::Min(), and UpdateCanWork().
Referenced by AddEnergy(), Entity::OnStoreLoad(), and SetEnergy0To1().
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value between 0 and 1.
Definition at line 519 of file ComponentEnergyManager.c.
References GetEnergyMax(), Math::Lerp(), and SetEnergy().
Energy manager: Changes the maximum amount of energy this device can store (when pristine).
Definition at line 608 of file ComponentEnergyManager.c.
References m_EnergyStorageMax.
Definition at line 1508 of file ComponentEnergyManager.c.
References m_EnergySource, m_EnergySourceNetworkIDHigh, m_EnergySourceNetworkIDLow, m_IsPlugged, StartUpdates(), and Synch().
Referenced by SetEnergySourceClient().
Definition at line 651 of file ComponentEnergyManager.c.
References SetEnergySource().
Energy manager: Changes the energy usage per second.
Definition at line 632 of file ComponentEnergyManager.c.
References m_EnergyUsage.
Definition at line 1625 of file ComponentEnergyManager.c.
References m_MySocketID.
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 427 of file ComponentEnergyManager.c.
References DeviceUpdate(), and m_IsPassiveDevice.
Referenced by Entity::OnStoreLoad().
|
inlineprotected |
Definition at line 1562 of file ComponentEnergyManager.c.
References m_DeviceByPlugSelection.
Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().
Definition at line 620 of file ComponentEnergyManager.c.
References m_PlugType.
Definition at line 1588 of file ComponentEnergyManager.c.
References m_IsWorking.
Referenced by DeviceUpdate(), and OnDeviceDestroyed().
Energy manager: Sets the interval of the OnWork(...) calls. Changing this value does not change the rate of energy consumption.
Definition at line 697 of file ComponentEnergyManager.c.
References m_UpdateInterval.
Referenced by Event_OnAwake().
|
inlineprotected |
Definition at line 1368 of file ComponentEnergyManager.c.
References CALL_CATEGORY_SYSTEM, GetUpdateInterval(), m_IsPassiveDevice, and m_UpdateTimer.
Referenced by AddEnergy(), Entity::OnVariablesSynchronized(), SetEnergySource(), and SwitchOn().
|
inlineprotected |
Definition at line 1404 of file ComponentEnergyManager.c.
References m_UpdateTimer.
Referenced by DeviceUpdate(), and SwitchOff().
|
inlineprotected |
Definition at line 599 of file ComponentEnergyManager.c.
References m_EnergySourceStorageIDb1, m_EnergySourceStorageIDb2, m_EnergySourceStorageIDb3, and m_EnergySourceStorageIDb4.
Referenced by Entity::OnStoreLoad().
|
inlineprotected |
Energy manager: Switches OFF the device.
Definition at line 392 of file ComponentEnergyManager.c.
References CanSwitchOff(), DeviceUpdate(), GetGame(), IsWorking(), m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StopUpdates(), Synch(), UpdateCanWork(), and WakeUpWholeBranch().
Referenced by DeviceUpdate(), HandleMoveInsideCargo(), OnDeviceDestroyed(), and Entity::OnVariablesSynchronized().
|
inlineprotected |
Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
Definition at line 363 of file ComponentEnergyManager.c.
References CanSwitchOn(), DeviceUpdate(), GetGame(), m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StartUpdates(), Synch(), UpdateCanWork(), and WakeUpWholeBranch().
Referenced by Event_OnAwake(), Entity::OnStoreLoad(), and Entity::OnVariablesSynchronized().
|
inlineprotected |
Definition at line 1630 of file ComponentEnergyManager.c.
References Component::m_ThisEntityAI.
Referenced by SetEnergySource(), SwitchOff(), SwitchOn(), and UpdateCanWork().
|
inlineprotected |
Energy manager: Unplugs everything directly connected to this device.
Definition at line 488 of file ComponentEnergyManager.c.
References Get(), GetPluggedDevices(), GetPluggedDevicesCount(), and UnplugDevice().
Referenced by OnDeviceDestroyed().
Definition at line 1570 of file ComponentEnergyManager.c.
References _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), Component::m_ThisEntityAI, SetDeviceBySocketID(), SetPlugOwner(), SOCKET_, and ToString().
Referenced by UnplugDevice().
Energy manager: Unplugs the given device from this one.
Definition at line 435 of file ComponentEnergyManager.c.
References GetGame(), 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 478 of file ComponentEnergyManager.c.
References GetEnergySource(), GetGame(), and Component::m_ThisEntityAI.
Referenced by OnAttachmentRemoved(), OnDeviceDestroyed(), Entity::OnVariablesSynchronized(), and UpdatePlugState().
|
inlineprotected |
Definition at line 670 of file ComponentEnergyManager.c.
References CanWork(), GetGame(), 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 565 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 525 of file ComponentEnergyManager.c.
References _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), GetEnergySource(), GetSocketsCount(), Component::m_ThisEntityAI, SEL_CORD_FOLDED, SEL_CORD_PLUGGED, SOCKET_, and ToString().
|
inlineprotected |
Definition at line 1490 of file ComponentEnergyManager.c.
References _AVAILABLE, _PLUGGED, Component::m_ThisEntityAI, SetDeviceBySocketID(), SetPlugOwner(), SOCKET_, and ToString().
Referenced by PlugCordIntoSocket().
Definition at line 1439 of file ComponentEnergyManager.c.
References GetPluggedDevices(), and GetSocketsCount().
Referenced by DeviceUpdate(), PlugInDevice(), SwitchOff(), and SwitchOn().
Definition at line 64 of file ComponentEnergyManager.c.
Referenced by UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().
Definition at line 63 of file ComponentEnergyManager.c.
Referenced by Event_OnAwake(), IsSelectionAPlug(), UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().
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().
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 DebugUpdate(), RefreshDebug(), UnplugDevice(), and ~ComponentEnergyManager().
Definition at line 21 of file ComponentEnergyManager.c.
Referenced by ComponentEnergyManager(), GetDebugPlugs(), OnIsPlugged(), RefreshDebug(), SetDebugPlugs(), and UnplugDevice().
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().
Definition at line 74 of file ComponentEnergyManager.c.
Referenced by Event_OnAwake(), and OnEnergyAdded().
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().
Definition at line 77 of file ComponentEnergyManager.c.
Referenced by Event_OnAwake().
Definition at line 66 of file ComponentEnergyManager.c.
Referenced by PlugInDevice(), UnplugDevice(), and UpdateSelections().
Definition at line 65 of file ComponentEnergyManager.c.
Referenced by ActionUnplugThisByCord::ActionCondition(), Event_OnAwake(), PlugInDevice(), UnplugDevice(), and UpdateSelections().
Definition at line 62 of file ComponentEnergyManager.c.
Referenced by Event_OnAwake(), IsSelectionAPlug(), UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().