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

◆ UnplugDevice()

void ComponentEnergyManager::UnplugDevice ( EntityAI device_to_unplug)
inlineprotected

Energy manager: Unplugs the given device from this one.

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

461 {
462 if (g_Game)
463 {
464 int indexStart = GetPluggedDevicesCount() - 1;
465 bool deviceFound = false;
466
467 for (int i = indexStart; i >= 0; --i)
468 {
469 EntityAI plugged_device = GetPluggedDevices().Get(i);
470
471 if (plugged_device == device_to_unplug)
472 {
473 GetPluggedDevices().Remove(i);
474 deviceFound = true;
475 break;
476 }
477 }
478
479 if (deviceFound && m_ThisEntityAI)
480 {
481 int socket_ID = device_to_unplug.GetCompEM().GetMySocketID();
482 UnplugCordFromSocket(socket_ID);
483 device_to_unplug.GetCompEM().SetEnergySource(null);
484 device_to_unplug.GetCompEM().DeviceUpdate();
485 device_to_unplug.GetCompEM().StartUpdates();
486 device_to_unplug.GetCompEM().WakeUpWholeBranch(m_ThisEntityAI);
487
489 {
490 m_DebugPlugArrow.Destroy();
491 m_DebugPlugArrow = null;
492 }
493
494 OnOwnSocketReleased(device_to_unplug);
495 device_to_unplug.GetCompEM().OnIsUnplugged(m_ThisEntityAI);
496 device_to_unplug.ShowSelection(SEL_CORD_FOLDED);
497 device_to_unplug.HideSelection(SEL_CORD_PLUGGED);
498 }
499 }
500 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3942
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:1723
int GetPluggedDevicesCount()
Energy manager: Returns the number of devices plugged into this one.
Определения ComponentEnergyManager.c:1201
array< EntityAI > GetPluggedDevices()
Energy manager: Returns an array of devices which are plugged into this one.
Определения ComponentEnergyManager.c:1377
Shape m_DebugPlugArrow
Определения ComponentEnergyManager.c:22
static const string SEL_CORD_PLUGGED
Определения ComponentEnergyManager.c:65
void OnOwnSocketReleased(EntityAI device)
Определения ComponentEnergyManager.c:1453

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

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