All pastes #270673 Raw Edit

Someone

public text v1 · immutable
·published 2006-12-07 16:38 UTC
rendered paste body
	protected void copyTo(BABoard that){
		super.copyTo(that);
		try {
			for(Field f:Class.forName("nevo.gocore.BABoard").getDeclaredFields()){
				if( f.getType().isArray() ){
					System.arraycopy(f.get(this), 0, f.get(that), 0, Array.getLength(f.get(this)));
				}else if( f.getType().isPrimitive()){
					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
	public BABoard deepClone(){
		BABoard clone = new BABoard(sideSize,komi);
		copyTo(clone);
		return clone;
	}