Ejemplo n.º 1
0
  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;
  }