industrialtest/machines/activated_electric_machine.lua

45 lines
1.9 KiB
Lua

-- IndustrialTest
-- Copyright (C) 2024 mrkubax10
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
industrialtest.ActivatedElectricMachine=table.copy(industrialtest.ElectricMachine)
function industrialtest.ActivatedElectricMachine.onTimer(self,pos,elapsed)
local result=self:powerExchange(pos)
local result2=industrialtest.ActivatedMachine.onTimer(self,pos,elapsed)
return result or result2
end
industrialtest.ActivatedElectricMachine.register=industrialtest.ActivatedMachine.register
industrialtest.ActivatedElectricMachine.createDefinitionTable=industrialtest.ActivatedMachine.createDefinitionTable
industrialtest.ActivatedElectricMachine.createActiveDefinitionTable=industrialtest.ActivatedMachine.createActiveDefinitionTable
industrialtest.ActivatedElectricMachine.shouldActivate=industrialtest.ActivatedMachine.shouldActivate
industrialtest.ActivatedElectricMachine.shouldDeactivate=industrialtest.ActivatedMachine.shouldDeactivate
industrialtest.ActivatedElectricMachine.afterActivation=industrialtest.ActivatedMachine.afterActivation
industrialtest.ActivatedElectricMachine.afterDeactivation=industrialtest.ActivatedMachine.afterDeactivation
function industrialtest.ActivatedElectricMachine.activeOnTimer(self,pos,elapsed)
local result=self:powerExchange(pos)
local result2=industrialtest.ActivatedMachine.activeOnTimer(self,pos,elapsed)
return result or result2
end