diff --git a/projet.use b/projet.use index be3e908..e126cb7 100644 --- a/projet.use +++ b/projet.use @@ -77,12 +77,17 @@ attributes nom: String operations tirer(case: String): TypeCoup + -- pre libre: plateau.cases. tirerRobot(): TypeCoup end class Flotte operations ajouterBateau(bateau: Bateau) + pre torpilleur: bateau.type = TypeBateau::Torpilleur implies bateaux->select(b: Bateau | b.type = TypeBateau::Torpilleur)->size() < 1 + pre contre_torpilleur: bateau.type = TypeBateau::Contre_Torpilleur implies bateaux->select(b: Bateau | b.type = TypeBateau::Contre_Torpilleur)->size() < 2 + pre croiseur: bateau.type = TypeBateau::Croiseur implies bateaux->select(b: Bateau | b.type = TypeBateau::Croiseur)->size() < 1 + pre porte_avions: bateau.type = TypeBateau::Porte_Avions implies bateaux->select(b: Bateau | b.type = TypeBateau::Porte_Avions)->size() < 1 constraints -- Contraintes qui vérifient le nombre de bateaux par type inv torpilleur: bateaux->select(b: Bateau | b.type = TypeBateau::Torpilleur)->size() = 1 @@ -109,7 +114,9 @@ attributes y: Integer type: TypeCase operations - changerEtat(nouveauEtat: TypeCase) + changerEtat(nouveauEtat: TypeCase) + pre different: not(nouveauEtat = type) + post change: type = nouveauEtat getEtat(): TypeCase constraints -- Contrainte qui vérifie qu'il n'y a pas deux cases au même endroit diff --git a/projet_default.clt b/projet_default.clt index 44b7a0b..d93b649 100644 --- a/projet_default.clt +++ b/projet_default.clt @@ -3,73 +3,73 @@ false false - false + true true true - false + true true false Plateau - 303.0 - 283.0 + 362.0 + 241.0 false Flotte - 201.0 - 365.0 + 370.0 + 385.0 false Coup - 234.0 - 72.0 + 280.0 + 73.0 false Bateau - 396.0 - 371.0 + 640.0 + 382.0 false Jeu - 33.0 - 90.0 + 25.0 + 85.0 false Joueur - 97.0 - 216.0 + 122.0 + 289.0 false Case - 457.0 - 190.0 + 566.0 + 73.0 false TypeCoup - 705.0 + 857.0 36.0 false @@ -77,7 +77,7 @@ TypeCase - 705.0 + 857.0 346.0 false @@ -85,7 +85,7 @@ EtatBateau - 705.0 + 857.0 260.0 false @@ -93,7 +93,7 @@ TypeBateau - 705.0 + 857.0 137.0 false @@ -146,19 +146,6 @@ false - - cases - - 8.0 - 6.0 - Repartit::WayPoint::0 - 8 - 8 - TOP - - false - @@ -173,6 +160,19 @@ false + + cases + + 8.0 + 6.0 + Repartit::WayPoint::0 + 8 + 8 + TOP + + false + Plateau Compose + + plateau + + -17.0 + -5.0 + Compose::WayPoint::1 + 8 + 8 + TOP + + false + @@ -221,19 +234,6 @@ false - - plateau - - -17.0 - -5.0 - Compose::WayPoint::1 - 8 - 8 - TOP - - false - @@ -250,19 +250,6 @@ false - - cases - - -6.0 - -17.0 - Compose::WayPoint::0 - 8 - 8 - TOP - - false - @@ -277,6 +264,19 @@ false + + cases + + -6.0 + -17.0 + Compose::WayPoint::0 + 8 + 8 + TOP + + false + Flotte Appartient - - flotte - - -3.0 - 15.0 - Appartient::WayPoint::1 - 8 - 8 - TOP - - false - @@ -440,6 +427,19 @@ false + + flotte + + -3.0 + 15.0 + Appartient::WayPoint::1 + 8 + 8 + TOP + + false + @@ -517,27 +517,12 @@ Plateau Utilise - - 1 - - 0.0 - 0.0 - Utilise::WayPoint::1 - 8 - 8 - BOTTOM - - false - + sizeCalculated="true" type="rolename" userDefined="true" visible="true"> plateau - 0.0 - 0.0 + -2.0 + -23.0 Utilise::WayPoint::1 8 8 @@ -545,6 +530,20 @@ false + + 1 + + 26.0 + 9.0 + Utilise::WayPoint::1 + 8 + 8 + BOTTOM + + false + @@ -565,8 +564,8 @@ sizeCalculated="true" type="rolename" userDefined="true" visible="true"> joueur - -1.0 - 7.0 + 12.0 + 24.0 Utilise::WayPoint::0 8 8 @@ -622,19 +621,6 @@ Jeu Joue2 - - jeu2 - - -10.0 - 7.0 - Joue2::WayPoint::1 - 8 - 8 - TOP - - false - @@ -649,6 +635,19 @@ false + + jeu2 + + -10.0 + 7.0 + Joue2::WayPoint::1 + 8 + 8 + TOP + + false + @@ -670,8 +669,8 @@ userDefined="true" visible="true"> 1 - -7.0 - 4.0 + 15.0 + -15.0 Joue2::WayPoint::0 8 8 @@ -683,8 +682,8 @@ sizeCalculated="true" type="rolename" userDefined="true" visible="true"> joueur2 - -16.0 - 34.0 + -10.0 + 13.0 Joue2::WayPoint::0 8 8 @@ -889,8 +888,8 @@ sizeCalculated="true" type="rolename" userDefined="true" visible="true"> joueur1 - 62.0 - -25.0 + 6.0 + -5.0 Joue1::WayPoint::0 8 8 @@ -933,7 +932,7 @@ - 1 + 0..100 0.0 0.0 @@ -973,20 +972,6 @@ false - - * - - 0.0 - 0.0 - Tire::WayPoint::0 - 8 - 8 - BOTTOM - - false - joueur @@ -1000,6 +985,20 @@ false + + 1 + + 6.0 + -8.0 + Tire::WayPoint::0 + 8 + 8 + BOTTOM + + false +