class 'CutSceneBase' (Node)

-------------------------------------------------------------------------------
function CutSceneBase:__init(panel)
	Node.__init(self, panel:getMainEntity(), 'CutSceneBase', 5)
	self.game_scene = panel.game_scene

	if self.CreateLoaderTable then
		local table_resource = self:CreateLoaderTable()
		LoadScene(self.main_entity, table_resource)
	end

	self:setupBars()
end

-------------------------------------------------------------------------------
function CutSceneBase:setupBars()
	self.bar_height = 80
	self:getEntityNamed('skip_button'):hide()

	self.bottom_bar_in_position = self:getEntityNamed('anchor_bottom'):getPosition()
	self.bottom_bar_out_position = self:getEntityNamed('anchor_bottom'):getPosition() + Vector2f(0, self.bar_height)

	self.top_bar_in_position = self:getEntityNamed('anchor_top'):getPosition()
	self.top_bar_out_position = self:getEntityNamed('anchor_top'):getPosition() + Vector2f(0, -self.bar_height)
end

-------------------------------------------------------------------------------
function CutSceneBase:moveIn(move_time)
	self:getEntityNamed('anchor_top'):destroyEffectors()
	self:getEntityNamed('anchor_bottom'):destroyEffectors()

	self:getEntityNamed('anchor_top'):MoveTo(self.top_bar_in_position.x, self.top_bar_in_position.y, move_time, 0, false)
	self:getEntityNamed('anchor_bottom'):MoveTo(self.bottom_bar_in_position.x, self.bottom_bar_in_position.y, move_time, 0, false)

	self:getEntityNamed('anchor_top'):setRespondable(true)
	self:getEntityNamed('anchor_bottom'):setRespondable(true)
end

-------------------------------------------------------------------------------
function CutSceneBase:moveOut(move_time)
	self:getEntityNamed('anchor_top'):destroyEffectors()
	self:getEntityNamed('anchor_bottom'):destroyEffectors()
	
	self:getEntityNamed('anchor_top'):MoveTo(self.top_bar_out_position.x, self.top_bar_out_position.y, move_time, 0, false)
	self:getEntityNamed('anchor_bottom'):MoveTo(self.bottom_bar_out_position.x, self.bottom_bar_out_position.y, move_time, 0, false)

	self:getEntityNamed('anchor_top'):setRespondable(false)
	self:getEntityNamed('anchor_bottom'):setRespondable(false)

	self:getSkipButton():setRespondable(false)
end

-------------------------------------------------------------------------------
function CutSceneBase:getSkipButton()
	return self:getEntityNamed('skip_button')
end