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

◆ PlugCordIntoSocket()

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

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

1581 {
1582 if (socket_id >= 0)
1583 {
1584 EntityAI plug_owner_by_socket = GetDeviceBySocketID(socket_id);
1585
1586 if (!plug_owner_by_socket)
1587 {
1588 UpdateSocketSelections(socket_id, device_to_plug);
1589 return;
1590 }
1591 }
1592
1593 int slots_c = GetSocketsCount();
1594
1595 for ( int i = 0; i < slots_c; ++i )
1596 {
1597 EntityAI plug_owner = GetDeviceBySocketID(i);
1598
1599 if ( !plug_owner ) // Check if this socket is available
1600 {
1601 UpdateSocketSelections(i, device_to_plug);
1602 break;
1603 }
1604 }
1605 }
class LogManager EntityAI
int GetSocketsCount()
Energy manager: Returns the count of power sockets (whenever used or not)
Определения ComponentEnergyManager.c:1134
void UpdateSocketSelections(int socket_id, EntityAI device_to_plug)
Определения ComponentEnergyManager.c:1608
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1330

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

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