industrialtest/machines/activated_electric_machine.lua

45 lines
2.0 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)
-- Forward methods from ActivatedMachine
industrialtest.internal.unpackTableInto(industrialtest.ActivatedElectricMachine,{
canUpdate=industrialtest.ActivatedMachine.canUpdate,
register=industrialtest.ActivatedMachine.register,
createDefinitionTable=industrialtest.ActivatedMachine.createDefinitionTable,
createActiveDefinitionTable=industrialtest.ActivatedMachine.createActiveDefinitionTable,
activate=industrialtest.ActivatedMachine.activate,
deactivate=industrialtest.ActivatedMachine.deactivate,
shouldActivate=industrialtest.ActivatedMachine.shouldActivate,
shouldDeactivate=industrialtest.ActivatedMachine.shouldDeactivate,
afterActivation=industrialtest.ActivatedMachine.afterActivation,
afterDeactivation=industrialtest.ActivatedMachine.afterDeactivation
})
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
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