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

◆ PlugCordIntoSocket()

void ComponentEnergyManager::PlugCordIntoSocket ( EntityAI device_to_plug,
int socket_id = -1 )
inlineprotected

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

1551 {
1552 if (socket_id >= 0)
1553 {
1554 EntityAI plug_owner_by_socket = GetDeviceBySocketID(socket_id);
1555
1556 if (!plug_owner_by_socket)
1557 {
1558 UpdateSocketSelections(socket_id, device_to_plug);
1559 return;
1560 }
1561 }
1562
1563 int slots_c = GetSocketsCount();
1564
1565 for ( int i = 0; i < slots_c; ++i )
1566 {
1567 EntityAI plug_owner = GetDeviceBySocketID(i);
1568
1569 if ( !plug_owner ) // Check if this socket is available
1570 {
1571 UpdateSocketSelections(i, device_to_plug);
1572 break;
1573 }
1574 }
1575 }
class LogManager EntityAI
int GetSocketsCount()
Energy manager: Returns the count of power sockets (whenever used or not)
Определения ComponentEnergyManager.c:1102
void UpdateSocketSelections(int socket_id, EntityAI device_to_plug)
Определения ComponentEnergyManager.c:1578
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1298

Перекрестные ссылки GetDeviceBySocketID(), GetSocketsCount() и UpdateSocketSelections().

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