DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CanReceivePlugFrom()

bool ComponentEnergyManager::CanReceivePlugFrom ( EntityAI device_to_plug)
inlineprotected

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

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

1016 {
1017 // The following conditions are broken down for the sake of easier reading/debugging.
1018 if (m_ThisEntityAI && HasFreeSocket() && device_to_plug != m_ThisEntityAI)
1019 {
1020 if ( device_to_plug.GetCompEM().GetEnergySource() != m_ThisEntityAI)
1021 {
1022 if ( IsPlugCompatible(device_to_plug.GetCompEM().GetPlugType()) )
1023 {
1024 if ( device_to_plug.GetCompEM().IsEnergySourceAtReach( device_to_plug.GetPosition(), 0, m_ThisEntityAI.GetPosition() ) )
1025 {
1026 return true;
1027 }
1028 }
1029 }
1030 }
1031
1032 return false;
1033 }
EntityAI m_ThisEntityAI
Определения Component.c:24
bool HasFreeSocket(int socket_id=-1)
Energy manager: Returns true if this device has any free socket to receive a plug....
Определения ComponentEnergyManager.c:955
bool IsPlugCompatible(int plug_ID)
Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceiveP...
Определения ComponentEnergyManager.c:985

Перекрестные ссылки HasFreeSocket(), IsPlugCompatible() и Component::m_ThisEntityAI.

Используется в PlugInDevice().