DayZ 1.30
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 строка 972

973 {
974 if ( plug_ID == PLUG_UNDEFINED )
975 {
976 return true; // When plugType is undefined in config then make it compatible.
977 }
978
980 {
981 int nCompatiblePlugTypes = m_CompatiblePlugTypes.Count();
982 for ( int i = 0; i < nCompatiblePlugTypes; ++i )
983 {
984 int plug_ID_to_Check = m_CompatiblePlugTypes.Get(i);
985
986 if ( plug_ID_to_Check == plug_ID )
987 {
988 return true;
989 }
990 }
991 }
992 else
993 {
994 // Since the config parameter compatiblePlugTypes is not present, then accept all plugs for simplicity's sake
995 return true;
996 }
997
998 return false;
999 }
const int PLUG_UNDEFINED
ref TIntArray m_CompatiblePlugTypes
Определения ComponentEnergyManager.c:68

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

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