local image = require("love_src.wrapper.lappy.new.image").obj

local components = {}

components.dict = {
  image_frame = "image_frame",
  trigger_frame = "trigger_frame",
  frame_i = "frame_i",
  run_time = "run_time",
  anim_direction = "anim_direction",
  next_trigger_frame = "next_trigger_frame",
  fps = "fps"
}

function components.image_frame (c, paths)
  c.data = {
    images = {},
    path = paths or {}
  }
  for k, v in ipairs(paths) do
    table.insert(c.data.images, image:load_to(v, v))
  end
end

function components.trigger_frame (c, array)
  c.data = array or {}
end

function components.frame_i (c, index)
  c.data = index or 1
end

function components.run_time (c, float)
  c.data = float or 0
end

function components.anim_direction (c, one)
  c.data = one or 1
end

function components.next_trigger_frame (c, index)
  c.data = index or 1
end

function components.fps (c, frame_per_second)
  c.data = frame_per_second or 12
end

return components
