local vm = require("lib.vornmath")

local components = {}

components.dict = {
  forward = "race.forward",
  velocity = "race.velocity",
  max_speed = "race.max_speed",
  min_speed = "race.min_speed",
  accel = "race.accel",
  grip = "race.grip",
  steer = "race.steer",
  brake = "race.brake",
  mass = "race.mass",
  inertia = "race.inertia",
  streamline = "race.streamline",
}

function components.forward (c, x, y)
  c.data = vm.vec2(x, y)
end

function components.velocity (c, x, y)
  c.data = vm.vec2(x, y)
end

function components.max_speed (c, x)
  c.data = x
end

function components.min_speed (c, x)
  c.data = x
end

function components.accel (c, x)
  c.data = x
end

function components.grip (c, x)
  c.data = x
end

function components.steer (c, x)
  c.data = x
end

function components.brake (c, x)
  c.data = x
end

function components.mass (c, x)
  c.data = x
end

function components.inertia (c, x, y)
  c.data = vm.vec2(x, y)
end

function components.streamline (c, x)
  c.data = x
end

return components
