package sudoku;

public class ContrainteLigne implements Contrainte {
    @Override
    public boolean estRespectee(Grille grille, Case c) {
        int ligne = c.getLigne();
        Symbole symbole = c.getSymbole();
        for (int col = 0; col < grille.getTaille(); col++) {
            Case currentCase = grille.getCase(ligne, col);
            if (currentCase != c && currentCase.getSymbole() != null && currentCase.getSymbole().equals(symbole)) {
                return false;
            }
        }
        return true;
    }
}