18 lines
399 B
Lua
18 lines
399 B
Lua
require "door"
|
|
|
|
WiredDoor = class("WiredDoor", Door)
|
|
|
|
function WiredDoor:initialize(x, y, color, circuitId)
|
|
Door.initialize(self, x, y, color)
|
|
self.circuitId = circuitId
|
|
self.wired = true
|
|
end
|
|
|
|
function WiredDoor:setPowered(powered, canClose)
|
|
if powered then
|
|
if self.locked then self:unlock() end
|
|
elseif canClose ~= false and not self.locked then
|
|
self:lock()
|
|
end
|
|
self:refreshSprites()
|
|
end
|