-- ************************************ Event ************************************ --
Event = getClass("Event")
Event.playedAnimations = {}

function Event:onInitialized()
	eventBar.description = self.eventBarText
	if (self.eventBarImage) then
		eventBar.icon = self.eventBarImage
	elseif (self.baseAnimation and self.defaultSection) then
		eventBar.icon = self.baseAnimation .. "_BAR:" .. self.defaultSection
	end
	self.won = false
end

function Event:onStartAnimation()
	if (self.sequenceStart) then
		return taskSystem:createAnimation(self.sequenceStart, self.sequenceStartParams)
	elseif (isTable(taskSystem:getAnimationDesc("eventStart")))then
		return taskSystem:createAnimation("eventStart")
	end
end

function Event:onMouseDown(x, y)
end

function Event:onMouseUp(x, y)
end

function Event:onMouseMoved(x, y, lButtonDown)
end

function Event:onMessageClick(command, id, object)
end

function Event:playIfNotPlayedBefore(animName)
	if (not self.playedAnimations[animName]) then
		self.playedAnimations[animName] = true
		return taskSystem:createAnimation(animName)
	end
end

function Event:createPostShiftAnimation()
	if (not self.won and isTable(taskSystem:getAnimationDesc("eventLost"))) then
		return self:playIfNotPlayedBefore("eventLost")
	end
end

function Event:onShiftFinish()

end