class MyWorld extends World { Board b; MyWorld(Board b) { this.b = b; } // the world is unchanged by clock ticks public World onTick() { return this; } // create a new world with the shape moved on a valid keystroke public World onKeyEvent(String in) { return ((in.equals("1") ? b.makeMove(1) : (in.equals("2") ?b.makeMove(2) : (in.equals ("3") ? b.makeMove(3) : (in.equals ("4") ? b.makeMove(5) : b))))); } // draw the world public boolean draw(){ return b.draw(this.theCanvas); } }