public static int MinMaxCheck(int check, int min, int max) { if(check < min) check = min; else if(check > max) check = max; return check; }