racket/collects/htdch/draw/World.java
2006-07-31 02:52:25 +00:00

35 lines
1.1 KiB
Java

package draw;
public abstract class World {
protected Canvas theCanvas;
public boolean bigBang(int width, int height, double s) {
if (width <= 0)
throw new RuntimeException(
"The method bigBang(int,int,double) expects " +
"the first argument to be greather than 0, given "
+ width);
if (height <= 0)
throw new RuntimeException(
"The method bigBang(int,int,double) expects " +
"the second argument to be greather than 0, given "
+ height);
if (s <= 0)
throw new RuntimeException(
"The method bigBang(int,int,double) expects " +
"the third argument to be greather than 0, given "
+ s);
theCanvas = new Canvas(width,height);
return bigBangO(s);
};
private native boolean bigBangO(double s);
// --------------------------------------------------------
public native boolean endOfTime(String s);
public native World endOfWorld(String s);
public abstract World onTick();
public abstract World onKeyEvent(String ke);
public abstract boolean draw();
public abstract boolean erase();
}