
class 'elevatorButton' (Product)

elevatorButton.elevatorName = nil

function elevatorButton:__init(baseName) super(baseName)
end

function elevatorButton:onClick()
	local elevator = getAppliance(self.elevatorName)
	if (elevator ~= nil) then
		elevator:requestFloor(self:getBase())
		self:playSound(self:getWorkSound())
	end
end

function elevatorButton:setElevatorName(name)
	self.elevatorName = name
end
