/* * mathutil.h * BoE * * Created by Celtic Minstrel on 16/04/09. * */ #pragma once #include #include // Make sure min and max macros are not defined. // Some Windows headers may define these. #ifdef min #undef min #endif #ifdef max #undef max #endif using std::abs; short get_ran(short times, short min, short max); short max(short a,short b); short min(short a,short b); short minmax(short min,short max,short k); short gcd(short a, short b); sf::Time time_in_ticks(int ticks); template inline void move_to_zero(T& val){ if(val < 0) val++; if(val > 0) val--; }