local system_constructor = require("love_src.wrapper.Concord.system")
local c_video = require("love_src.src.world.common.component.video")

local system = {}

system.__index = system

system.pool = {
  pool = {
    c_video.dict.video,
  }
}

system.components = {
  [c_video.dict.video] = c_video.video,
}

function system.new()
  local new_system = system_constructor.new("video_render", system.pool)
  if (new_system) then
    for k, v in pairs(system) do
		  new_system[k] = v
	  end
    return new_system
  else
    return nil
  end
end

function system:load()
  for _, e in ipairs(self.pool) do
    video = e[c_video.dict.video].data.video
    video:play()
  end
end

function system:update(dt)
  for _, e in ipairs(self.pool) do
    video = e[c_video.dict.video].data.video
  end
end

function system:draw()
  for _, e in ipairs(self.pool) do
    video = e[c_video.dict.video].data.video
    love.graphics.draw(video, 0, 0)
  end
end

return system
