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

◆ IsPlugCompatible()

bool ComponentEnergyManager::IsPlugCompatible ( int plug_ID)
inlineprotected

Energy manager: Checks if the given plug is compatible with this device's socket. Used by CanReceivePlugFrom() method.

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

948 {
949 if ( plug_ID == PLUG_UNDEFINED )
950 {
951 return true; // When plugType is undefined in config then make it compatible.
952 }
953
955 {
956 for ( int i = 0; i < m_CompatiblePlugTypes.Count(); i++ )
957 {
958 int plug_ID_to_Check = m_CompatiblePlugTypes.Get(i);
959
960 if ( plug_ID_to_Check == plug_ID )
961 {
962 return true;
963 }
964 }
965 }
966 else
967 {
968 // Since the config parameter compatiblePlugTypes is not present, then accept all plugs for simplicity's sake
969 return true;
970 }
971
972 return false;
973 }
const int PLUG_UNDEFINED
Определения _constants.c:23
ref TIntArray m_CompatiblePlugTypes
Определения ComponentEnergyManager.c:68

Перекрестные ссылки m_CompatiblePlugTypes и PLUG_UNDEFINED.

Используется в CanReceivePlugFrom() и Event_OnAwake().