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

◆ PlugCordIntoSocket()

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

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

1611 {
1612 if (socket_id >= 0)
1613 {
1614 EntityAI plug_owner_by_socket = GetDeviceBySocketID(socket_id);
1615
1616 if (!plug_owner_by_socket)
1617 {
1618 UpdateSocketSelections(socket_id, device_to_plug);
1619 return;
1620 }
1621 }
1622
1623 int slots_c = GetSocketsCount();
1624
1625 for ( int i = 0; i < slots_c; ++i )
1626 {
1627 EntityAI plug_owner = GetDeviceBySocketID(i);
1628
1629 if ( !plug_owner ) // Check if this socket is available
1630 {
1631 UpdateSocketSelections(i, device_to_plug);
1632 break;
1633 }
1634 }
1635 }
class LogManager EntityAI
int GetSocketsCount()
Energy manager: Returns the count of power sockets (whenever used or not)
Определения ComponentEnergyManager.c:1147
void UpdateSocketSelections(int socket_id, EntityAI device_to_plug)
Определения ComponentEnergyManager.c:1638
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1343

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

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