#pragma once // a collection of useful funtions that i use across projects #include #include #include #include #include #include "Random.h" template T getRandomNumber(U min, V max) { return static_cast(Random::get(min, max)); } template inline sf::Color createColor(T r, U g, V b, W a) { return sf::Color(static_cast(r), static_cast(g), static_cast(b), static_cast(a)); } template inline sf::Color createColor(T r, U g, V b, std::uint8_t a = 255u) { return sf::Color(static_cast(r), static_cast(g), static_cast(b), a); } sf::Color getRandomColor() { return sf::Color(getRandomNumber(0u, 255u), getRandomNumber(0u, 255u), getRandomNumber(0u, 255u)); } template T signage(T in) { T zero{}; if (in > zero) return ++zero; if (in < zero) return --zero; return zero; }