-- ************************************ Station ************************************ --
PillsStation = deriveLuaClass("PillsStation", "WorkStation")

function PillsStation:init(desc)
	PillsStation.superInit(desc)
	self:setFrame(self.stock)
end

function PillsStation:onStockChange()
	self.clickable = self.stock > 0
end

function PillsStation:onDisplayStockChange()
	self:setFrame(self.stock)
	if (self.stock == 0) then
		self:createOverhead("ICON_NO_STOCK:icons")
		hintManager:handle({id="empty_pills", sprite=self})
	else
		self:removeOverhead()
	end
end

function PillsStation:onPlaceCharacter(character)
	PillsStation.super.onPlaceCharacter(self, character)
end

function PillsStation:onWorkStart(task)
	PillsStation.super.onWorkStart(self, task)
	self:decStock()
end

function PillsStation:onWorkFinish(task)
	PillsStation.super.onWorkFinish(self, task)
	self:decDisplayStock()
end

function PillsStation:onLeave(character)
	self.clickable = true
end
