Private 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. | |
protected void | StopUpdates () |
void | InteractBranch (EntityAI originalCaller, Man player=null, int system=0) |
protected 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. | |
protected void | WakeUpWholeBranch (EntityAI original_caller) |
protected void | PlugCordIntoSocket (EntityAI device_to_plug, int socket_id=-1) |
protected void | UpdateSocketSelections (int socket_id, EntityAI device_to_plug) |
protected void | SetEnergySource (EntityAI source) |
protected bool | PlugInDevice (EntityAI device_to_plug, int socket_id=-1) |
protected void | SetPlugOwner (string selection_name, EntityAI device) |
protected void | UnplugCordFromSocket (int socket_to_unplug_ID) |
protected void | SetPowered (bool state) |
protected bool | FindAndConsumeEnergy (EntityAI original_caller, float amount, bool ignore_switch_state=false) |
protected int | GetMySocketID () |
protected void | SetMySocketID (int slot_ID) |
void | Synch () |
void | ClearLastUpdateTime () |
void | RememberLastUpdateTime () |
float | GetCurrentUpdateTime () |
void | DeviceUpdate () |
Static Private Attributes | |
static protected bool | m_DebugPlugs = false |
static protected const string | SOCKET_ = "socket_" |
static protected const string | _PLUGGED = "_plugged" |
static protected const string | _AVAILABLE = "_available" |
static const string | SEL_CORD_PLUGGED = "cord_plugged" |
static const string | SEL_CORD_FOLDED = "cord_folded" |
|
inlineprivate |
References m_DebugPlugs.
|
inlineprivate |
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.
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.
References Component::m_ThisEntityAI.
Energy manager: Returns true if this device can receive power plug of the other device.
References HasFreeSocket(), IsPlugCompatible(), and Component::m_ThisEntityAI.
Referenced by PlugInDevice().
|
inlineprivate |
Energy manager: Checks if the device can be switched OFF.
References IsPassive(), and IsSwitchedOn().
Referenced by SwitchOff().
|
inlineprivate |
Energy manager: Checks if the device can be switched ON.
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. References CheckWetness(), DPrint(), GetEnergy(), GetEnergySource(), GetEnergyUsage(), GetGame(), m_CanWork, and Component::m_ThisEntityAI.
Referenced by UpdateCanWork().
|
inlineprivate |
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.
References Component::m_ThisEntityAI, and m_WetnessExposure.
Referenced by CanWork(), and DeviceUpdate().
|
inlineprivate |
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.
References FindAndConsumeEnergy(), and Component::m_ThisEntityAI.
Referenced by DeviceUpdate().
|
inlineprivate |
|
inlineprivate |
References ScriptModule::CallFunction(), CheckWetness(), ClearLastUpdateTime(), ConsumeEnergy(), CGame::GameScript, 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().
|
inlineprivate |
References vector::Normalize(), vector::Perpend(), and Shape.
Referenced by DebugUpdate().
|
inlineprivate |
References _PLUGGED, CALL_CATEGORY_SYSTEM, CGame::ConfigGetChildName(), CGame::ConfigGetChildrenCount(), CGame::ConfigGetFloat(), CGame::ConfigGetIntArray(), CGame::ConfigGetText(), 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_, SwitchOn(), and string::ToString().
|
inlineprivate |
References ScriptModule::CallFunction(), CGame::GameScript, GetGame(), and Component::m_ThisEntityAI.
|
inlineprivate |
References AddEnergy(), GetEnergySource(), IsPlugged(), IsSwitchedOn(), and Component::m_ThisEntityAI.
Referenced by ConsumeEnergy().
|
inlineprivate |
References m_AttachmentActionType.
Referenced by OnAttachmentAdded(), and OnAttachmentRemoved().
|
inlineprivate |
References m_CompatiblePlugTypes.
|
inlineprivate |
References COMP_TYPE_ENERGY_MANAGER.
|
inlineprivate |
Energy manager: Returns the length of the virtual power cord.
References m_CordLength.
Referenced by IsEnergySourceAtReach().
|
inlineprivate |
Energy manager: Returns path to the cord texture file.
References m_CordTextureFile.
|
inlineprivate |
References GetGame(), and CGame::GetTime().
Referenced by DeviceUpdate(), and RememberLastUpdateTime().
|
inlineprivate |
References m_DebugPlugs.
Referenced by DebugUpdate().
Energy manager: Returns the device which is plugged into the given socket ID.
References m_Sockets.
Referenced by HasFreeSocket(), PlugCordIntoSocket(), UnplugCordFromSocket(), and UpdateSelections().
|
inlineprivate |
Energy manager: Returns the amount of stored energy this device has.
References m_Energy.
Referenced by AddEnergy(), CanWork(), ItemBase::HasEnoughEnergyForRepair(), HasEnoughStoredEnergy(), Entity::OnStoreSave(), and TransferEntityVariables().
|
inlineprivate |
Energy manager: Returns % of stored energy this device has as float (from 0.0 to 1.0)
References m_Energy, and m_EnergyStorageMax.
|
inlineprivate |
Energy manager: Returns % of stored energy this device has as integer (from 0 to 100)
References m_Energy, m_EnergyStorageMax, and Math::Round().
|
inlineprivate |
References m_EnergyAtSpawn.
Referenced by InventoryItem::SetCEBasedQuantity().
|
inlineprivate |
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.
References GetEnergyMaxPristine(), GetGame(), m_ReduceMaxEnergyByDamageCoef, and Component::m_ThisEntityAI.
Referenced by AddEnergy(), and SetEnergy0To1().
|
inlineprivate |
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken into account.
References m_EnergyStorageMax.
Referenced by GetEnergyMax(), and InventoryItem::SetCEBasedQuantity().
|
inlineprivate |
Energy manager: Returns the energy source this device is plugged into.
References m_EnergySource.
Referenced by CanWork(), DebugUpdate(), FindAndConsumeEnergy(), Entity::GetDebugText(), IsEnergySourceAtReach(), OnAttachmentRemoved(), Entity::OnStoreSave(), UnplugThis(), and UpdateSelections().
|
inlineprivate |
References m_EnergySourceNetworkIDHigh.
Referenced by Entity::OnVariablesSynchronized().
|
inlineprivate |
References m_EnergySourceNetworkIDLow.
Referenced by Entity::OnVariablesSynchronized().
|
inlineprivate |
References m_EnergySourceStorageIDb1.
Referenced by Entity::EEOnAfterLoad().
|
inlineprivate |
References m_EnergySourceStorageIDb2.
Referenced by Entity::EEOnAfterLoad().
|
inlineprivate |
References m_EnergySourceStorageIDb3.
Referenced by Entity::EEOnAfterLoad().
|
inlineprivate |
References m_EnergySourceStorageIDb4.
Referenced by Entity::EEOnAfterLoad().
|
inlineprivate |
Energy manager: Returns the number of energy this device needs to run itself (See its config >> energyUsagePerSecond)
References m_EnergyUsage.
Referenced by CanWork(), DeviceUpdate(), HasEnoughStoredEnergy(), and SetEnergy().
|
inlineprivate |
References m_MySocketID.
|
inlineprivate |
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.
References GetPluggedDevices(), and GetPluggedDevicesCount().
Energy manager: Returns an array of devices which are plugged into this one.
References m_PluggedDevices.
Referenced by GetPluggedDevice(), GetPluggedDevicesCount(), GetPoweredDevices(), InteractBranch(), IsSelectionAPlug(), PlugInDevice(), UnplugAllDevices(), UnplugDevice(), and WakeUpWholeBranch().
|
inlineprivate |
Energy manager: Returns the number of devices plugged into this one.
References GetPluggedDevices().
Referenced by GetPluggedDevice(), GetPoweredDevices(), HasFreeSocket(), UnplugAllDevices(), and UnplugDevice().
Energy manager: Returns the device to which the given plug selection belongs to.
References m_DeviceByPlugSelection.
|
inlineprivate |
Energy manager: Returns plug type. Check \DZ\data\basicDefines.hpp OR \Scripts\Classes\Component_constants.h files for types of plugs.
References m_PlugType.
Energy manager: Returns an array of devices which are plugged into this one and are turned on.
References GetPluggedDevices(), GetPluggedDevicesCount(), and IsSwitchedOn().
|
inlineprivate |
References m_IsSwichedOnPreviousState.
Referenced by Entity::OnVariablesSynchronized().
|
inlineprivate |
References m_RestorePlugState.
Referenced by Entity::EEOnAfterLoad().
|
inlineprivate |
Energy manager: Returns the count of power sockets (whenever used or not)
References m_SocketsCount.
Referenced by Event_OnAwake(), HasFreeSocket(), InteractBranch(), IsSelectionAPlug(), PlugCordIntoSocket(), UpdateSelections(), and WakeUpWholeBranch().
|
inlineprivate |
References Component::m_ThisEntityAI.
|
inlineprivate |
Energy manager: Returns the update interval of this device.
References m_UpdateInterval.
Referenced by StartUpdates().
|
inlineprivate |
Returns wetness exposure value defined in config.
References m_WetnessExposure.
|
inlineprivate |
References IsSwitchedOn(), m_AutoSwitchOffWhenInCargo, and SwitchOff().
Referenced by Entity::OnMovedInsideCargo().
|
inlineprivate |
Energy manager: Returns true if this item automatically converts its energy to quantity.
References m_ConvertEnergyToQuantity.
|
inlineprivate |
Energy manager: Returns true if the electricity icon (bolt) is supposed to be visible for this device. False if not.
References m_HasElectricityIcon.
|
inlineprivate |
Energy manager: Returns true if this device has enough of stored energy for its own use.
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.
References GetDeviceBySocketID(), GetPluggedDevicesCount(), and GetSocketsCount().
Referenced by CanReceivePlugFrom().
|
inlineprivate |
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
References GetPluggedDevices(), GetSocketsCount(), and OnInteractBranch().
Referenced by PlugInDevice().
|
inlineprivate |
Energy manager: Returns true if the cord of this device is folded. Returns false if it's plugged.
References IsPlugged().
|
inlineprivate |
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. References vector::Distance(), GetCordLength(), GetEnergySource(), and IsPlugged().
Referenced by Hologram::CorrectMaterialPathName(), and UpdatePlugState().
|
inlineprivate |
Energy manager: Returns true if this device is set to be passive. False if otherwise.
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.
References m_CompatiblePlugTypes, and PLUG_UNDEFINED.
Referenced by CanReceivePlugFrom(), and Event_OnAwake().
|
inlineprivate |
Energy manager: Returns true if this device is plugged into some other device (even if they are OFF or ruined). Otherwise it returns false.
References m_IsPlugged.
Referenced by Hologram::CorrectMaterialPathName(), 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.
References _PLUGGED, GetPluggedDevices(), GetSocketsCount(), SOCKET_, and string::ToString().
|
inlineprivate |
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.
References m_IsSwichedOn.
Referenced by CanSwitchOff(), CanSwitchOn(), DeviceUpdate(), FindAndConsumeEnergy(), Entity::GetDebugText(), GetPoweredDevices(), HandleMoveInsideCargo(), Entity::OnStoreSave(), Entity::OnVariablesSynchronized(), and TransferEntityVariables().
|
inlineprivate |
Energy manager: Returns true if this device is working right now.
References m_IsWorking.
Referenced by DeviceUpdate(), Entity::GetDebugText(), Entity::IsIgnited(), and SwitchOff().
|
inlineprivate |
References GetAttachmentAction(), Component::m_ThisEntityAI, PLUG_ATTACHMENTS_INTO_THIS, PLUG_THIS_INTO_ATTACHMENT, and PlugThisInto().
Referenced by Entity::EEItemAttached().
|
inlineprivate |
References GetAttachmentAction(), GetEnergySource(), PLUG_ATTACHMENTS_INTO_THIS, PLUG_THIS_INTO_ATTACHMENT, and UnplugThis().
Referenced by Entity::EEItemDetached().
|
inlineprivate |
References Component::m_ThisEntityAI, SetPowered(), SwitchOff(), UnplugAllDevices(), and UnplugThis().
Referenced by Entity::EEDelete().
|
inlineprivate |
Energy manager: Called when energy was added on this device.
References Component::m_ThisEntityAI, m_UpdateQuantityTimer, and Timer::Stop().
Referenced by AddEnergy().
|
inlineprivate |
Energy manager: Called when energy was consumed on this device.
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.
References Component::m_ThisEntityAI.
Referenced by InteractBranch().
|
inlineprivate |
References CALL_CATEGORY_SYSTEM, m_DebugPlugs, m_DebugUpdate, Component::m_ThisEntityAI, and UpdateCanWork().
|
inlineprivate |
References Component::m_ThisEntityAI, and UpdateCanWork().
|
inlineprivate |
References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.
Referenced by UnplugDevice().
|
inlineprivate |
References Component::m_ThisEntityAI, and PLUG_COMMON_APPLIANCE.
Referenced by PlugInDevice().
|
inlineprivate |
References Component::m_ThisEntityAI.
Referenced by DeviceUpdate().
References GetDeviceBySocketID(), GetSocketsCount(), and UpdateSocketSelections().
Referenced by PlugInDevice().
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.
References Component::m_ThisEntityAI.
Referenced by Entity::EEOnAfterLoad(), OnAttachmentAdded(), and Entity::OnVariablesSynchronized().
|
inlineprivate |
References CALL_CATEGORY_SYSTEM, m_DebugPlugArrow, m_DebugPlugs, and m_DebugUpdate.
Referenced by SetDebugPlugs().
|
inlineprivate |
References GetCurrentUpdateTime(), and m_LastUpdateTime.
Referenced by DeviceUpdate().
|
inlineprivate |
Energy manager: Resets energy usage to default (config) value.
References CGame::ConfigGetFloat(), GetGame(), m_EnergyUsage, and Component::m_ThisEntityAI.
|
inlineprivate |
References m_RestorePlugState.
Referenced by Entity::OnStoreLoad().
|
inlineprivate |
References m_AttachmentActionType.
|
inlineprivate |
Energy manager: Changes the length of the virtual power cord.
References m_CordLength.
|
inlineprivate |
References m_CordTextureFile.
|
inlineprivate |
References m_DebugPlugs, and RefreshDebug().
Energy manager: Stores the device which is plugged into the given socket ID.
References m_Sockets.
Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().
|
inlineprivate |
Energy manager: Sets visibility of the electricity icon (bolt).
References m_HasElectricityIcon.
|
inlineprivate |
Energy manager: Sets stored energy for this device. It ignores the min/max limit!
References GetEnergyUsage(), GetGame(), m_Energy, Component::m_ThisEntityAI, Math::Min(), and UpdateCanWork().
Referenced by AddEnergy(), Entity::OnStoreLoad(), SetEnergy0To1(), and TransferEntityVariables().
|
inlineprivate |
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value between 0 and 1.
References GetEnergyMax(), Math::Lerp(), and SetEnergy().
Referenced by InventoryItem::SetCEBasedQuantity().
|
inlineprivate |
Energy manager: Changes the maximum amount of energy this device can store (when pristine).
References m_EnergyStorageMax.
|
inlineprivate |
References m_EnergySource, m_EnergySourceNetworkIDHigh, m_EnergySourceNetworkIDLow, m_IsPlugged, StartUpdates(), and Synch().
Referenced by SetEnergySourceClient().
|
inlineprivate |
References SetEnergySource().
|
inlineprivate |
Energy manager: Changes the energy usage per second.
References m_EnergyUsage.
|
inlineprivate |
References m_MySocketID.
|
inlineprivate |
Energy manager: Changes the status of this device. When it's passive (true), the main timer and OnWork events are not used.
References DeviceUpdate(), and m_IsPassiveDevice.
Referenced by Entity::OnStoreLoad().
References m_DeviceByPlugSelection.
Referenced by UnplugCordFromSocket(), and UpdateSocketSelections().
|
inlineprivate |
References m_PlugType.
|
inlineprivate |
References m_IsWorking.
Referenced by DeviceUpdate(), and OnDeviceDestroyed().
|
inlineprivate |
Energy manager: Sets the interval of the OnWork(...) calls. Changing this value does not change the rate of energy consumption.
References m_UpdateInterval.
Referenced by Event_OnAwake().
|
inlineprivate |
References CALL_CATEGORY_SYSTEM, GetUpdateInterval(), m_IsPassiveDevice, and m_UpdateTimer.
Referenced by AddEnergy(), Entity::OnVariablesSynchronized(), SetEnergySource(), and SwitchOn().
|
inlineprivate |
References m_UpdateTimer, and Timer::Stop().
Referenced by DeviceUpdate(), and SwitchOff().
References m_EnergySourceStorageIDb1, m_EnergySourceStorageIDb2, m_EnergySourceStorageIDb3, and m_EnergySourceStorageIDb4.
Referenced by Entity::OnStoreLoad().
|
inlineprivate |
Energy manager: Switches OFF the device.
References ScriptModule::CallFunction(), CanSwitchOff(), DeviceUpdate(), CGame::GameScript, GetGame(), IsWorking(), m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StopUpdates(), Synch(), UpdateCanWork(), and WakeUpWholeBranch().
Referenced by DeviceUpdate(), HandleMoveInsideCargo(), OnDeviceDestroyed(), and Entity::OnVariablesSynchronized().
|
inlineprivate |
Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
References ScriptModule::CallFunction(), CanSwitchOn(), DeviceUpdate(), CGame::GameScript, GetGame(), m_IsSwichedOn, m_IsSwichedOnPreviousState, Component::m_ThisEntityAI, StartUpdates(), Synch(), UpdateCanWork(), and WakeUpWholeBranch().
Referenced by Event_OnAwake(), Entity::OnStoreLoad(), Entity::OnVariablesSynchronized(), and TransferEntityVariables().
|
inlineprivate |
References Component::m_ThisEntityAI.
Referenced by SetEnergySource(), SwitchOff(), SwitchOn(), and UpdateCanWork().
|
inlineprivate |
Energy manager: Unplugs everything directly connected to this device.
References Get(), GetPluggedDevices(), GetPluggedDevicesCount(), and UnplugDevice().
Referenced by OnDeviceDestroyed().
|
inlineprivate |
References _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), Component::m_ThisEntityAI, SetDeviceBySocketID(), SetPlugOwner(), SOCKET_, and ToString().
Referenced by UnplugDevice().
|
inlineprivate |
Energy manager: Unplugs the given device from this one.
References GetGame(), GetPluggedDevices(), GetPluggedDevicesCount(), m_DebugPlugArrow, m_DebugPlugs, Component::m_ThisEntityAI, OnOwnSocketReleased(), SEL_CORD_FOLDED, SEL_CORD_PLUGGED, and UnplugCordFromSocket().
Referenced by UnplugAllDevices().
|
inlineprivate |
Energy manager: Unplugs this device from its power source.
References GetEnergySource(), GetGame(), and Component::m_ThisEntityAI.
Referenced by OnAttachmentRemoved(), OnDeviceDestroyed(), Entity::OnVariablesSynchronized(), and UpdatePlugState().
|
inlineprivate |
References CanWork(), GetGame(), m_CanWork, Component::m_ThisEntityAI, and Synch().
Referenced by DeviceUpdate(), OnIsPlugged(), OnIsUnplugged(), SetEnergy(), SwitchOff(), and SwitchOn().
|
inlineprivate |
Energy manager: Unplugs this device when it's necesarry.
References IsEnergySourceAtReach(), Component::m_ThisEntityAI, and UnplugThis().
|
inlineprivate |
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)
References _AVAILABLE, _PLUGGED, GetDeviceBySocketID(), GetEnergySource(), GetSocketsCount(), Component::m_ThisEntityAI, SEL_CORD_FOLDED, SEL_CORD_PLUGGED, SOCKET_, ToString(), and string::ToString().
References _AVAILABLE, _PLUGGED, Component::m_ThisEntityAI, SetDeviceBySocketID(), SetPlugOwner(), SOCKET_, and ToString().
Referenced by PlugCordIntoSocket().
|
inlineprivate |
References GetPluggedDevices(), and GetSocketsCount().
Referenced by DeviceUpdate(), PlugInDevice(), SwitchOff(), and SwitchOn().
|
staticprivate |
Referenced by UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().
|
staticprivate |
Referenced by Event_OnAwake(), IsSelectionAPlug(), UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().
|
private |
Referenced by Event_OnAwake().
|
private |
Referenced by Event_OnAwake(), GetAttachmentAction(), and SetAttachmentAction().
|
private |
Referenced by DeviceUpdate(), and Event_OnAwake().
|
private |
Referenced by Event_OnAwake(), and HandleMoveInsideCargo().
|
private |
Referenced by DeviceUpdate().
|
private |
Referenced by CanWork(), DeviceUpdate(), Event_OnAwake(), and UpdateCanWork().
|
private |
Referenced by Event_OnAwake(), GetCompatiblePlugTypes(), and IsPlugCompatible().
|
private |
Referenced by Event_OnAwake(), and HasConversionOfEnergyToQuantity().
|
private |
Referenced by Event_OnAwake(), GetCordLength(), and SetCordLength().
|
private |
Referenced by Event_OnAwake(), GetCordTextureFile(), and SetCordTextureFile().
|
private |
Referenced by DebugUpdate(), RefreshDebug(), UnplugDevice(), and ~ComponentEnergyManager().
|
staticprivate |
Referenced by ComponentEnergyManager(), GetDebugPlugs(), OnIsPlugged(), RefreshDebug(), SetDebugPlugs(), and UnplugDevice().
|
private |
Referenced by DebugUpdate(), OnIsPlugged(), and RefreshDebug().
Referenced by Event_OnAwake(), GetPlugOwner(), and SetPlugOwner().
|
private |
Referenced by Event_OnAwake(), GetEnergy(), GetEnergy0To1(), GetEnergy0To100(), and SetEnergy().
|
private |
Referenced by Event_OnAwake(), and GetEnergyAtSpawn().
|
private |
Referenced by GetEnergySource(), and SetEnergySource().
|
private |
Referenced by GetEnergySourceNetworkIDHigh(), and SetEnergySource().
|
private |
Referenced by GetEnergySourceNetworkIDLow(), and SetEnergySource().
|
private |
Referenced by GetEnergySourceStorageIDb1(), and StoreEnergySourceIDs().
|
private |
Referenced by GetEnergySourceStorageIDb2(), and StoreEnergySourceIDs().
|
private |
Referenced by GetEnergySourceStorageIDb3(), and StoreEnergySourceIDs().
|
private |
Referenced by GetEnergySourceStorageIDb4(), and StoreEnergySourceIDs().
|
private |
Referenced by Event_OnAwake(), GetEnergy0To1(), GetEnergy0To100(), GetEnergyMaxPristine(), and SetEnergyMaxPristine().
|
private |
Referenced by Event_OnAwake(), GetEnergyUsage(), ResetEnergyUsage(), and SetEnergyUsage().
|
private |
Referenced by Event_OnAwake(), HasElectricityIcon(), and SetElectricityIconVisibility().
|
private |
Referenced by DeviceUpdate(), Event_OnAwake(), IsPassive(), SetPassiveState(), and StartUpdates().
|
private |
Referenced by IsPlugged(), and SetEnergySource().
|
private |
Referenced by IsSwitchedOn(), SwitchOff(), and SwitchOn().
|
private |
Referenced by GetPreviousSwitchState(), SwitchOff(), and SwitchOn().
|
private |
Referenced by IsWorking(), and SetPowered().
|
private |
Referenced by ClearLastUpdateTime(), DeviceUpdate(), and RememberLastUpdateTime().
|
private |
Referenced by GetMySocketID(), and SetMySocketID().
Referenced by Event_OnAwake(), and GetPluggedDevices().
|
private |
Referenced by Event_OnAwake(), GetPlugType(), and SetPlugType().
|
private |
Referenced by Event_OnAwake(), and GetEnergyMax().
|
private |
Referenced by GetRestorePlugState(), and RestorePlugState().
|
private |
Referenced by Event_OnAwake(), and HasVisibleSocketsInInventory().
|
private |
Referenced by Event_OnAwake(), GetDeviceBySocketID(), and SetDeviceBySocketID().
|
private |
Referenced by Event_OnAwake(), and GetSocketsCount().
|
private |
Referenced by GetUpdateInterval(), and SetUpdateInterval().
|
private |
Referenced by Event_OnAwake(), and OnEnergyAdded().
|
private |
Referenced by StartUpdates(), and StopUpdates().
|
private |
Referenced by CheckWetness(), Event_OnAwake(), and GetWetnessExposure().
|
private |
Referenced by Event_OnAwake().
|
staticprivate |
Referenced by PlugInDevice(), UnplugDevice(), and UpdateSelections().
|
staticprivate |
Referenced by ActionUnplugThisByCord::ActionCondition(), Event_OnAwake(), PlugInDevice(), UnplugDevice(), and UpdateSelections().
|
staticprivate |
Referenced by Event_OnAwake(), IsSelectionAPlug(), UnplugCordFromSocket(), UpdateSelections(), and UpdateSocketSelections().