112 lines
2.8 KiB
Text
112 lines
2.8 KiB
Text
!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
|
|
|
|
-- 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
|
|
|
|
!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_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(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(j1,attaque_plateau_j2) into Utilise
|
|
!insert(j1,defense_plateau_j2) into Utilise
|
|
|
|
|