DayZ 1.29
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 строка 985

986 {
987 if ( plug_ID == PLUG_UNDEFINED )
988 {
989 return true; // When plugType is undefined in config then make it compatible.
990 }
991
993 {
994 int nCompatiblePlugTypes = m_CompatiblePlugTypes.Count();
995 for ( int i = 0; i < nCompatiblePlugTypes; ++i )
996 {
997 int plug_ID_to_Check = m_CompatiblePlugTypes.Get(i);
998
999 if ( plug_ID_to_Check == plug_ID )
1000 {
1001 return true;
1002 }
1003 }
1004 }
1005 else
1006 {
1007 // Since the config parameter compatiblePlugTypes is not present, then accept all plugs for simplicity's sake
1008 return true;
1009 }
1010
1011 return false;
1012 }
const int PLUG_UNDEFINED
ref TIntArray m_CompatiblePlugTypes
Определения ComponentEnergyManager.c:68

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

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