private Point getPointInDirection(Point a, int direction) {//{{{
    	Point p;
    	switch(direction) {
    		case 0: 
    			p = new Point(a.x, a.y-1);
    			break;
    		case 1:
    			p = new Point(a.x+1, a.y-1);
    			break;
    		case 2:
    			p = new Point(a.x+1, a.y);
    			break;
    		case 3: 
    			p = new Point(a.x+1, a.y+1);
    			break;
    		case 4:
    			p = new Point(a.x, a.y+1);
    			break;
    		case 5: 
    			p = new Point(a.x-1, a.y+1);
    			break;
    		case 6:
    			p = new Point(a.x-1, a.y);
    			break;
    		case 7:
    			p = new Point(a.x-1, a.y-1);
    			break;
    		default:
    			p = null;
    			break;
    	}    	
    	return p;
    }//}}}