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

◆ HasFreeSocket()

bool ComponentEnergyManager::HasFreeSocket ( int socket_id = -1)
inlineprotected

Energy manager: Returns true if this device has any free socket to receive a plug. If optional parameter socket_id is provided then only that socket ID is checked.

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

943 {
944 if (socket_id == -1)
945 {
946 int plugged_devices = GetPluggedDevicesCount();
947 int plugged_devices_limit = GetSocketsCount();
948
949 if ( plugged_devices < plugged_devices_limit )
950 {
951 return true;
952 }
953
954 return false;
955 }
956 else
957 {
958 EntityAI device = GetDeviceBySocketID(socket_id);
959
960 if (device)
961 {
962 return false;
963 }
964 else
965 {
966 return true;
967 }
968 }
969 }
class LogManager EntityAI
int GetPluggedDevicesCount()
Energy manager: Returns the number of devices plugged into this one.
Определения ComponentEnergyManager.c:1188
int GetSocketsCount()
Energy manager: Returns the count of power sockets (whenever used or not)
Определения ComponentEnergyManager.c:1134
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1330

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

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