#pragma once

#include <array>

#include <cstddef>

namespace utils {

template<typename InType, typename OutType>
auto map(InType value, InType inMin, InType inMax, OutType outMin, OutType outMax)
{
    return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
}

template<typename>
struct array_size;

template<typename T, size_t N>
struct array_size<std::array<T, N>> {
    static constexpr auto value = N;
};

template<typename T>
inline constexpr auto array_size_v = array_size<T>::value;

} // namespace utils
