diff --git a/projet.use b/projet.use index a40ba48..8f3ed2b 100644 --- a/projet.use +++ b/projet.use @@ -63,10 +63,8 @@ operations changerEtat(nouveauEtat: TypeCase) getEtat(): TypeCase constraints - inv: - plateau.cases->select(c: Case | c.x = x and c.y = y)->size() = 1 - inv coordonne: - x <= 10 and x > 0 and y > 0 and y <= 10 + inv: plateau.cases->select(c: Case | c.x = x and c.y = y)->size() = 1 + inv: x <= 10 and x > 0 and y > 0 and y <= 10 end class Bateau @@ -75,12 +73,10 @@ attributes longueur: Integer Etat: EtatBateau constraints - inv longueur: - if type = TypeBateau::Torpilleur then longueur = 2 - else if type = TypeBateau::Contre_Torpilleur then longueur = 3 - else if type = TypeBateau::Croiseur then longueur = 4 - else longueur = 5 - endif endif endif + inv: type = TypeBateau::Torpilleur implies longueur = 2 + inv: type = TypeBateau::Contre_Torpilleur implies longueur = 3 + inv: type = TypeBateau::Croiseur implies longueur = 4 + inv: type = TypeBateau::Porte_Avions implies longueur = 5 end association Utilise between