package org.nusco.swimmers.creature.genetics;


class OrganParser {

	private final int[] genes;
	private int index_in_genes = 0;
	
	public OrganParser(DNA dna) {
		genes = dna.getGenes();
	}

	public int[] nextPart() {
		int[] result = new int[OrganBuilder.GENES_PER_PART];
		int index_in_result = 0;
		while(index_in_result < result.length) {
			if(index_in_genes >= genes.length)
				return result;
			if(isTerminator(genes[index_in_genes])) {
				index_in_genes++;
				return result;
			}
			result[index_in_result] = genes[index_in_genes];
			index_in_result++;
			index_in_genes++;
		}
		return result;
	}

	private boolean isTerminator(int b) {
		// TODO: is the idea of a terminator ever useful?
		// (for sure, it wasn't working the way I implemented it)
		return false;
	}
}

@@ -399,99 +399,8 @@
 lt;%0A
-%09%09%09if(isTerminator(genes%5Bindex_in_genes%5D)) %7B%0A%09%09%09%09index_in_genes++;%0A%09%09%09%09return result;%0A%09%09%09%7D%0A
 %09%09%09r
@@ -517,178 +517,7 @@
 ;%0A%09%7D
-%0A%0A%09private boolean isTerminator(int b) %7B%0A%09%09// TODO: is the idea of a terminator ever useful?%0A%09%09// (for sure, it wasn't working the way I implemented it)%0A%09%09return false;%0A%09%7D
 %0A%7D%0A

Remove the concept of a DNA terminator