-- ************************************ WorkStation ************************************ --
WorkStation = getClass("WorkStation")

function WorkStation:hasWorkToDo()
	return self.totalOccupants > 0
end

function WorkStation:addToStationTask()
	if (WorkStation.super.addToStationTask(self)) then
		self.clickable = not self.autoStart
		return true
	elseif (not self.autoStart) then
		hero:addTask({class="SetTask", positionLock=self})
		if (self:hasWorkToDo()) then
			hero:addTask({class="WorkTask", positionLock=self, target=self})
			self:stopFaultySelectionBlink()
		else
			hero:addTask({class="WalkToTask", target=self})
		end
		return true
	end
	return false
end
