public void drawLine(int x1, int y1, int x2, int y2, Dot dot) { int denom = Math.Max(Math.Abs(x1 - x2), Math.Abs(y1 - y2)); for (int numer = 0; numer <= denom; numer++) { double rate = (double)numer / denom; table.set( IntTools.toInt(x1 + rate * (x2 - x1)), IntTools.toInt(y1 + rate * (y2 - y1)), dot ); } }
public void toInt() { x = IntTools.toInt(x); y = IntTools.toInt(y); }
public static bool toFlag(string str) { return(equalsIgnoreCase(str, S_TRUE) || IntTools.toInt(str, 0, 2, 0) == 1); }