См. определение в файле ComponentEnergyManager.c строка 1747
1748 {
1749
1750
1751
1752
1753
1754
1756 {
1757
1759 {
1761 float consumed_energy_coef;
1762
1763
1765 {
1767 consumed_energy_coef = 1.0;
1768 }
1769 else
1770 {
1773 consumed_energy_coef = time / 1000;
1774 }
1775
1776 if (consumed_energy_coef > 0)
1777 {
1780 bool has_consumed_enough = true;
1781
1784
1786
1787 if ( has_consumed_enough )
1788 {
1789 if ( !was_powered )
1790 {
1795 }
1796
1797 OnWork( consume_energy );
1798 }
1799 else
1800 {
1801 if ( was_powered )
1802 {
1804 {
1809
1811 {
1813 }
1814 }
1815 }
1816
1818 }
1819 }
1820 else
1821 {
1823 }
1824 }
1826 {
1829
1831 {
1836
1838 {
1840 }
1841 }
1842 }
1843 }
1844 }
float GetEnergyUsage()
Energy manager: Returns the number of energy this device needs to run itself (See its config >> energ...
bool IsWorking()
Energy manager: Returns true if this device is working right now.
void WakeUpWholeBranch(EntityAI original_caller)
bool CheckWetness()
Energy manager: Checks if this device is being stopped from working by its wetness level....
float GetCurrentUpdateTime()
void ClearLastUpdateTime()
void OnWork(float consumed_energy)
void SetPowered(bool state)
void SwitchOff()
Energy manager: Switches OFF the device.
bool ConsumeEnergy(float amount)
Energy manager: Consumes the given amount of energy. If there is not enough of stored energy in this ...
void RememberLastUpdateTime()
bool IsSwitchedOn()
Energy manager: Returns state of the switch. Whenever the device is working or not does not matter....
proto native CGame GetGame()
proto volatile int CallFunction(Class inst, string function, out void returnVal, void parm)
Перекрестные ссылки ScriptModule::CallFunction(), CheckWetness(), ClearLastUpdateTime(), ConsumeEnergy(), CGame::GameScript, GetCurrentUpdateTime(), GetEnergyUsage(), GetGame(), IsSwitchedOn(), IsWorking(), m_AutoSwitchOff, m_CanStopWork, m_CanWork, m_IsPassiveDevice, m_LastUpdateTime, Component::m_ThisEntityAI, OnWork(), RememberLastUpdateTime(), SetPowered(), StopUpdates(), SwitchOff(), UpdateCanWork() и WakeUpWholeBranch().
Используется в SetPassiveState(), SwitchOff() и SwitchOn().