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

◆ UnplugDevice()

void ComponentEnergyManager::UnplugDevice ( EntityAI device_to_unplug)
inlineprotected

Energy manager: Unplugs the given device from this one.

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

448 {
449 if (g_Game)
450 {
451 int indexStart = GetPluggedDevicesCount() - 1;
452 bool deviceFound = false;
453
454 for (int i = indexStart; i >= 0; --i)
455 {
456 EntityAI plugged_device = GetPluggedDevices().Get(i);
457
458 if (plugged_device == device_to_unplug)
459 {
460 GetPluggedDevices().Remove(i);
461 deviceFound = true;
462 break;
463 }
464 }
465
466 if (deviceFound && m_ThisEntityAI)
467 {
468 int socket_ID = device_to_unplug.GetCompEM().GetMySocketID();
469 UnplugCordFromSocket(socket_ID);
470 device_to_unplug.GetCompEM().SetEnergySource(null);
471 device_to_unplug.GetCompEM().DeviceUpdate();
472 device_to_unplug.GetCompEM().StartUpdates();
473 device_to_unplug.GetCompEM().WakeUpWholeBranch(m_ThisEntityAI);
474
476 {
477 m_DebugPlugArrow.Destroy();
478 m_DebugPlugArrow = null;
479 }
480
481 OnOwnSocketReleased(device_to_unplug);
482 device_to_unplug.GetCompEM().OnIsUnplugged(m_ThisEntityAI);
483 device_to_unplug.ShowSelection(SEL_CORD_FOLDED);
484 device_to_unplug.HideSelection(SEL_CORD_PLUGGED);
485 }
486 }
487 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:4074
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:1693
int GetPluggedDevicesCount()
Energy manager: Returns the number of devices plugged into this one.
Определения ComponentEnergyManager.c:1188
array< EntityAI > GetPluggedDevices()
Energy manager: Returns an array of devices which are plugged into this one.
Определения ComponentEnergyManager.c:1364
Shape m_DebugPlugArrow
Определения ComponentEnergyManager.c:22
static const string SEL_CORD_PLUGGED
Определения ComponentEnergyManager.c:65
void OnOwnSocketReleased(EntityAI device)
Определения ComponentEnergyManager.c:1436

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

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