DayZ 1.27
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 строка 976

977 {
978 // The following conditions are broken down for the sake of easier reading/debugging.
979
980 if ( HasFreeSocket() && device_to_plug != m_ThisEntityAI)
981 {
982 if ( device_to_plug.GetCompEM().GetEnergySource() != m_ThisEntityAI)
983 {
984 if ( IsPlugCompatible(device_to_plug.GetCompEM().GetPlugType()) )
985 {
986 if ( device_to_plug.GetCompEM().IsEnergySourceAtReach( device_to_plug.GetPosition(), 0, m_ThisEntityAI.GetPosition() ) )
987 {
988 return true;
989 }
990 }
991 }
992 }
993
994 return false;
995 }
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:917
bool IsPlugCompatible(int plug_ID)
Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceiveP...
Определения ComponentEnergyManager.c:947

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

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