!Bataille := new Jeu !j1 := new Joueur !set j1.nom := 'Alpha' !j2 := new Joueur !set j2.nom := 'Beta' !flotte_j1 := new Flotte !flotte_j2 := new Flotte -- Bateau Joueur1 !bateau1_j1 := new Bateau !bateau1_j1.type := TypeBateau::Torpilleur !bateau1_j1.longueur := 2 !bateau1_j1.etat := EtatBateau::Operationnel !bateau1_j1.x1 := 1 !bateau1_j1.y1 := 1 !bateau1_j1.x2 := 2 !bateau1_j1.y2 := 1 !bateau2_j1 := new Bateau !bateau2_j1.type := TypeBateau::Croiseur !bateau2_j1.longueur := 4 !bateau2_j1.etat := EtatBateau::Operationnel !bateau2_j1.x1 := 3 !bateau2_j1.y1 := 3 !bateau2_j1.x2 := 3 !bateau2_j1.y2 := 6 !bateau3_j1 := new Bateau !bateau3_j1.type := TypeBateau::Contre_Torpilleur !bateau3_j1.longueur := 3 !bateau3_j1.etat := EtatBateau::Operationnel !bateau3_j1.x1 := 6 !bateau3_j1.y1 := 1 !bateau3_j1.x2 := 9 !bateau3_j1.y2 := 1 !bateau4_j1 := new Bateau !bateau4_j1.type := TypeBateau::Porte_Avions !bateau4_j1.longueur := 5 !bateau4_j1.etat := EtatBateau::Operationnel !bateau4_j1.x1 := 5 !bateau4_j1.y1 := 9 !bateau4_j1.x2 := 9 !bateau4_j1.y2 := 9 !bateau5_j1 := new Bateau !bateau5_j1.type := TypeBateau::Contre_Torpilleur !bateau5_j1.longueur := 3 !bateau5_j1.etat := EtatBateau::Operationnel !bateau5_j1.x1 := 6 !bateau5_j1.y1 := 2 !bateau5_j1.x2 := 9 !bateau5_j1.y2 := 2 -- Bateau Joueur2 !bateau1_j2 := new Bateau !bateau1_j2.type := TypeBateau::Torpilleur !bateau1_j2.longueur := 2 !bateau1_j2.etat := EtatBateau::Operationnel !bateau1_j2.x1 := 2 !bateau1_j2.y1 := 2 !bateau1_j2.x2 := 3 !bateau1_j2.y2 := 2 !bateau2_j2 := new Bateau !bateau2_j2.type := TypeBateau::Croiseur !bateau2_j2.longueur := 4 !bateau2_j2.etat := EtatBateau::Operationnel !bateau2_j2.x1 := 4 !bateau2_j2.y1 := 4 !bateau2_j2.x2 := 4 !bateau2_j2.y2 := 7 !bateau3_j2 := new Bateau !bateau3_j2.type := TypeBateau::Contre_Torpilleur !bateau3_j2.longueur := 3 !bateau3_j2.etat := EtatBateau::Operationnel !bateau3_j2.x1 := 5 !bateau3_j2.y1 := 1 !bateau3_j2.x2 := 8 !bateau3_j2.y2 := 1 !bateau4_j2 := new Bateau !bateau4_j2.type := TypeBateau::Porte_Avions !bateau4_j2.longueur := 5 !bateau4_j2.etat := EtatBateau::Operationnel !bateau4_j2.x1 := 5 !bateau4_j2.y1 := 6 !bateau4_j2.x2 := 9 !bateau4_j2.y2 := 6 !bateau5_j2 := new Bateau !bateau5_j2.type := TypeBateau::Contre_Torpilleur !bateau5_j2.longueur := 3 !bateau5_j2.etat := EtatBateau::Operationnel !bateau5_j2.x1 := 5 !bateau5_j2.y1 := 2 !bateau5_j2.x2 := 8 !bateau5_j2.y2 := 2 !insert(flotte_j1, bateau1_j1) into flotte_bateau !insert(flotte_j1, bateau2_j1) into flotte_bateau !insert(flotte_j1, bateau3_j1) into flotte_bateau !insert(flotte_j1, bateau4_j1) into flotte_bateau !insert(flotte_j1, bateau5_j1) into flotte_bateau !insert(flotte_j2, bateau1_j2) into flotte_bateau !insert(flotte_j2, bateau2_j2) into flotte_bateau !insert(flotte_j2, bateau3_j2) into flotte_bateau !insert(flotte_j2, bateau4_j2) into flotte_bateau !insert(flotte_j2, bateau5_j2) into flotte_bateau !insert(j1,Bataille) into EstEnJeu1 !insert(j2,Bataille) into EstEnJeu1 !insert (j1,flotte_j1) into flotte_joueur !insert (j2,flotte_j2) into flotte_joueur !attaque_plateau_j1 := new Plateau !defense_plateau_j1 := new Plateau !attaque_plateau_j2 := new Plateau !defense_plateau_j2 := new Plateau !insert(j1,attaque_plateau_j1) into Utilise !insert(j1,defense_plateau_j1) into Utilise !insert(j2,attaque_plateau_j2) into Utilise !insert(j2,defense_plateau_j2) into Utilise -- Les boucles for ne marchant pas, nous avons été obligé de procéder ainsi et -- de ne pas toute les initialiser, de plus elle aurait pris toute la place dans -- le diagramme d'instance !c1_1 := new Case !c1_1.x := 1 !c1_1.y := 1 !c1_1.type := TypeCase::Vide !insert(c1_1,attaque_plateau_j1) into Compose !c1_2 := new Case !c1_2.x := 1 !c1_2.y := 2 !c1_2.type := TypeCase::Vide !insert(c1_2,attaque_plateau_j2) into Compose !c1_3 := new Case !c1_3.x := 1 !c1_3.y := 3 !c1_3.type := TypeCase::Vide !insert(c1_3,defense_plateau_j2) into Compose