// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

#pragma once

#include <functional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "wpi/glass/Model.hpp"

struct ImVec2;

namespace wpi::glass {
class DoubleSource;
class DriveModel : public Model {
 public:
  struct WheelInfo {
    std::string name;
    DoubleSource* percent;
    std::function<void(double)> setter;

    WheelInfo(std::string_view name, DoubleSource* percent,
              std::function<void(double)> setter)
        : name(name), percent(percent), setter(std::move(setter)) {}
  };

  virtual const char* GetName() const = 0;
  virtual const std::vector<WheelInfo>& GetWheels() const = 0;

  virtual ImVec2 GetVelocityVector() const = 0;

  // Clamped between -1 and 1 with -1 being full CCW.
  virtual double GetRotation() const = 0;
};
void DisplayDrive(DriveModel* m);
}  // namespace wpi::glass
