package com.danitheskunk.skunkworks;

public class Util {
	public static String nullTerminatedCharArrayToString(char[] chars) {
		int len = chars.length;
		for(int i = 0; i < chars.length; ++i) {
			if(chars[i] == '\0') {
				len = i;
				break;
			}
		}
		return new String(chars, 0, len);
	}

	public static double tweenDouble(double a, double b, double amount) {
		return (b - a) * amount + a;
	}

	public static int tweenInt(int a, int b, double amount) {
		return (int) ((b - a) * amount + a);
	}
}
