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

◆ UnplugDevice()

void ComponentEnergyManager::UnplugDevice ( EntityAI device_to_unplug)
inlineprotected

Energy manager: Unplugs the given device from this one.

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

452 {
453 if ( GetGame() )
454 {
455 int indexStart = GetPluggedDevicesCount() - 1;
456 bool deviceFound = false;
457
458 for (int i = indexStart; i >= 0; --i)
459 {
460 EntityAI plugged_device = GetPluggedDevices().Get(i);
461
462 if (plugged_device == device_to_unplug)
463 {
464 GetPluggedDevices().Remove(i);
465 deviceFound = true;
466 break;
467 }
468 }
469
470 if (deviceFound)
471 {
472 int socket_ID = device_to_unplug.GetCompEM().GetMySocketID();
473 UnplugCordFromSocket(socket_ID);
474 device_to_unplug.GetCompEM().SetEnergySource(null);
475 device_to_unplug.GetCompEM().DeviceUpdate();
476 device_to_unplug.GetCompEM().StartUpdates();
477 device_to_unplug.GetCompEM().WakeUpWholeBranch(m_ThisEntityAI);
478
480 {
481 m_DebugPlugArrow.Destroy();
482 m_DebugPlugArrow = null;
483 }
484
485 OnOwnSocketReleased(device_to_unplug);
486 device_to_unplug.GetCompEM().OnIsUnplugged(m_ThisEntityAI);
487 device_to_unplug.ShowSelection(SEL_CORD_FOLDED);
488 device_to_unplug.HideSelection(SEL_CORD_PLUGGED);
489 }
490 }
491 }
class LogManager EntityAI
EntityAI m_ThisEntityAI
Определения Component.c:24
static const string SEL_CORD_FOLDED
Определения ComponentEnergyManager.c:66
static bool m_DebugPlugs
Определения ComponentEnergyManager.c:21
void UnplugCordFromSocket(int socket_to_unplug_ID)
Определения ComponentEnergyManager.c:1660
int GetPluggedDevicesCount()
Energy manager: Returns the number of devices plugged into this one.
Определения ComponentEnergyManager.c:1156
array< EntityAI > GetPluggedDevices()
Energy manager: Returns an array of devices which are plugged into this one.
Определения ComponentEnergyManager.c:1332
Shape m_DebugPlugArrow
Определения ComponentEnergyManager.c:22
static const string SEL_CORD_PLUGGED
Определения ComponentEnergyManager.c:65
void OnOwnSocketReleased(EntityAI device)
Определения ComponentEnergyManager.c:1402
proto native CGame GetGame()

Перекрестные ссылки GetGame(), GetPluggedDevices(), GetPluggedDevicesCount(), m_DebugPlugArrow, m_DebugPlugs, Component::m_ThisEntityAI, OnOwnSocketReleased(), SEL_CORD_FOLDED, SEL_CORD_PLUGGED и UnplugCordFromSocket().

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