DayZ 1.27
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 строка 917

918 {
919 if (socket_id == -1)
920 {
921 int plugged_devices = GetPluggedDevicesCount();
922 int plugged_devices_limit = GetSocketsCount();
923
924 if ( plugged_devices < plugged_devices_limit )
925 {
926 return true;
927 }
928
929 return false;
930 }
931 else
932 {
933 EntityAI device = GetDeviceBySocketID(socket_id);
934
935 if (device)
936 {
937 return false;
938 }
939 else
940 {
941 return true;
942 }
943 }
944 }
class LogManager EntityAI
int GetPluggedDevicesCount()
Energy manager: Returns the number of devices plugged into this one.
Определения ComponentEnergyManager.c:1156
int GetSocketsCount()
Energy manager: Returns the count of power sockets (whenever used or not)
Определения ComponentEnergyManager.c:1102
EntityAI GetDeviceBySocketID(int id)
Energy manager: Returns the device which is plugged into the given socket ID.
Определения ComponentEnergyManager.c:1298

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

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