All pastes #894902 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-07 11:57 UTC
rendered paste body
	public void copyInto(Colony newColony, int row, int col, boolean overwrite) 
	{
		
		for(int i = 0; i < newColony.getHeight(); i++) {
			if((i > -1) && (i < this.getHeight())) {
				for(int j = 0; j  < newColony.getWidth(); j++) {
					if((j > -1) && (j < this.getWidth())) {
						if(this.getCell(i,j)) {
							newColony.setCell(row+i, col+j, true);	
						}
						else {
							if(overwrite) {
								newColony.setCell(row+i, col+j, false);
							}
						}
					}
				}
			}
		}
	}