local perspective = require("love_src.src.world.2_town_square.component.perspective")
local pos3d = require("love_src.src.world.2_town_square.component.pos3d")

local template = {}

template.default_data = {
  resolution = {love.graphics.getDimensions()}, -- resolution x, y
  lanes = 3,
  draw_distance = 300,
  road_width = 2000,

  fog_density = 0,

  -- player
  pos = {0, 1, 0},
  player_width = 50,
  centrifugal = 0.3,
  player_speed = 0,
  player_max_speed = 5000,
  player_accel = 100,

  -- camera
  field_of_view = 140, -- field of view
  camera_height = 1000,

  -- road segment
  segment_length = 200,
  segment_count = 500,
  rumble_length = 3,


  segment_path = "love_src/data/map/segment.json",
  segment_sprite_map_path = "love_src/data/map/sprites.json",
}

function template.assemble(e, data)
  e:give(perspective.dict.camera_height, data.camera_height)
  e:give(perspective.dict.draw_distance, data.draw_distance)
  e:give(perspective.dict.field_of_view, data.field_of_view)
  e:give(perspective.dict.fog_density, data.fog_density)
  e:give(perspective.dict.lanes, data.lanes)
  e:give(perspective.dict.resolution, data.resolution.x, data.resolution.y)
  e:give(perspective.dict.road_width, data.road_width)
  e:give(perspective.dict.rumble_length, data.rumble_length)
  e:give(perspective.dict.segment_count, data.segment_count)
  e:give(perspective.dict.segment_length, data.segment_length)
  e:give(perspective.dict.segment_path, data.segment_path)
  e:give(perspective.dict.segment_sprite_map_path, data.segment_sprite_map_path)

  e:give(pos3d.dict.pos, data.pos[1], data.pos[2], data.pos[3])
end

return template
