private String rnaString() { String ret = ""; for (DNANucleotide nuc : nucleotides) { ret += nuc.partnerType(); } return ret; }
public String toString() { String ret = ""; for (DNANucleotide nuc : nucleotides) { ret += nuc.type(); } return ret; }
public boolean computeValidity() { Game.State state; if (!isComplete()) return false; if (this.exactMatch()) state = Game.State.Good; else if (Game.codonGroups.sameGroup(Game.dnaToRNA(this.toString()), this.rnaString())) state = Game.State.Acceptable; else { state = Game.State.Bad; } // Update score game.score.codonCompleted(state); for (DNANucleotide dna : nucleotides) { dna.setState(state); } return true; }
private boolean allOffScreen() { for (DNANucleotide dna : nucleotides) { if (!dna.offScreen()) return false; } return true; }
// Have all the DNA bases in this codon been attached? // Doesn't matter if they're correctly attached or not public boolean isComplete() { for (DNANucleotide dna : nucleotides) { if (!dna.attached()) return false; } return true; }
public boolean exactMatch() { for (DNANucleotide dna : nucleotides) { if (!dna.matchesPartner()) return false; } return true; }