2026-08-11 22:55:58 -04:00
|
|
|
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
|
|
|
|
|
|
2026-08-12 00:21:53 -04:00
|
|
|
function WiredDoor:setPowered(powered, canClose)
|
2026-08-11 22:55:58 -04:00
|
|
|
if powered then
|
|
|
|
|
if self.locked then self:unlock() end
|
2026-08-12 00:21:53 -04:00
|
|
|
elseif canClose ~= false and not self.locked then
|
2026-08-11 22:55:58 -04:00
|
|
|
self:lock()
|
|
|
|
|
end
|
|
|
|
|
self:refreshSprites()
|
|
|
|
|
end
|