Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider e0b30a7f rédigé par Jamal ATTOU's avatar Jamal ATTOU
Parcourir les fichiers

Jamal : Implémentation jeu du touché coulé

parent c52a58e7
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 74 ajouts et 86 suppressions
<component name="ArtifactManager">
<artifact type="jar" name="battleship-student-project-2021:jar">
<output-path>$PROJECT_DIR$/out/artifacts/battleship_student_project_2021_jar</output-path>
<root id="archive" name="battleship-student-project-2021.jar">
<element id="module-output" name="battleship-student-project-2021" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/battleship-library-1.1.jar" path-in-jar="/" />
</root>
</artifact>
</component>
\ No newline at end of file
......@@ -190,8 +190,24 @@
<orderEntry type="module-library" scope="TEST">
<library name="JUnit4">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/junit/junit/4.12/junit-4.12.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library name="JUnit5.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
......@@ -200,14 +216,14 @@
<orderEntry type="module-library" scope="TEST">
<library name="JUnit5.4">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
......@@ -216,14 +232,14 @@
<orderEntry type="module-library" scope="TEST">
<library name="JUnit5.4">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" />
<root url="jar://$USER_HOME$/.m2/repository/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
......
img/fond.jpg

902 ko

Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
Fichier supprimé
Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
import controleurs.*;
import info1.ships.NavyFleet;
import modele.VariableLocal;
import vues.*;
......@@ -19,5 +20,6 @@ public class AppliGame {
fenetre.ListenerCommentJouer(new ListenerCommentJouer(fenetre));
}
}
Manifest-Version: 1.0
Main-Class: AppliGame
......@@ -2,6 +2,8 @@ package controleurs;
import com.mashape.unirest.http.exceptions.UnirestException;
import info1.network.BadIdException;
import info1.network.Game;
import info1.network.Network;
import info1.network.Player;
import info1.ships.*;
......@@ -14,16 +16,18 @@ import java.util.ArrayList;
public class ListenerBoutonCreate implements ActionListener {
private MenuPartie fenetre1;
private ArrayList test;
NavyFleet flotte1 = new NavyFleet(); //faire une méthode getNavyFleet
public ListenerBoutonCreate(MenuPartie fenetre){
this.fenetre1= fenetre;
}
public void actionPerformed(ActionEvent clic) {
MenuJeu fenetre3 = new MenuJeu("Interface de jeu");
//fenetre3.EtatFlotte(false);
System.out.println(fenetre1.getMaflotte());
MenuJeu fenetre3 = new MenuJeu("Fenetre de jeu",fenetre1.getMaflotte());
fenetre3.selectionnercase(new ListenerMouseJouer(fenetre3));
fenetre3.pack();
fenetre3.setVisible(true);
......@@ -31,65 +35,19 @@ public class ListenerBoutonCreate implements ActionListener {
try {
flotte1.add(new AircraftCarrier("monPorteAvion", "E5", "E9"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
flotte1.add(new Battleship("monCuirasse", "B2", "E2"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
flotte1.add(new Submarine("monSousMarin", "G10"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
flotte1.add(new Cruiser("monCroiseur", "B8", "B6"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
flotte1.add(new Destroyer("monTorpilleur", "H3", "H4"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
flotte1.add(new Destroyer("autreTorpilleur", "D9", "C9"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
flotte1.add(new Cruiser("autreCroiseur", "J8", "H8"));
} catch (BadCoordException e) {
e.printStackTrace();
} catch (CoordsBadShipException e) {
e.printStackTrace();
}
try {
test = new ArrayList(Network.listActivePlayers("http://37.187.38.219/api/v0"));
JOptionPane optionPane = new JOptionPane("L'ID de votre partie est : " + (Network.initNewGame("http://37.187.38.219/api/v0", fenetre1.getPlayerVues(), flotte1)).getId() + " et ton nom est : " +fenetre1.getPlayerVues().getName(), JOptionPane.ERROR_MESSAGE) ;
Game JoinGame = new Game(fenetre1.donneId());
ArrayList test = new ArrayList(Network.listActivePlayers("http://37.187.38.219/api/v0"));
JOptionPane optionPane = new JOptionPane("L'ID de votre partie est : " + (Network.initNewGame("http://37.187.38.219/api/v0", fenetre1.getPlayerVues(), fenetre1.getMaflotte())).getId() + " et ton nom est : " +fenetre1.getPlayerVues().getName(), JOptionPane.ERROR_MESSAGE) ;
JDialog dialog = optionPane.createDialog("Message d'information");
dialog.setAlwaysOnTop(true);
dialog.setVisible(true);
fenetre3.setGame(JoinGame);
fenetre1.dispose();
} catch (UnirestException | UncompleteFleetException | BadCoordException exception) {
} catch (UnirestException | UncompleteFleetException | BadCoordException | BadIdException exception) {
exception.printStackTrace();
}
......
......@@ -22,7 +22,7 @@ public class ListenerBoutonFlotteBelgique implements ActionListener {
fenetre3.pack();
fenetre3.setVisible(true);
fenetre3.MouseLister(new ListenerMouse(fenetre3));
fenetre3.MouseLister(new ListenerMouseCreerFlotte(fenetre3));
fenetre3.ListenerJouer(new ListenerJouer(fenetre3));
try {
fenetre3.PositionnerBateau(fenetre3.creerflotteBelge());
......
......@@ -19,7 +19,7 @@ public class ListenerBoutonFlotteFrance implements ActionListener {
fenetre3.pack();
fenetre3.setVisible(true);
fenetre3.MouseLister(new ListenerMouse(fenetre3));
fenetre3.MouseLister(new ListenerMouseCreerFlotte(fenetre3));
fenetre3.ListenerJouer(new ListenerJouer(fenetre3));
try {
fenetre3.PositionnerBateau(fenetre3.creerflotteFrancaise());
......
......@@ -28,8 +28,8 @@ public class ListenerBoutonInscription implements ActionListener {
}else{
Player player1 = new Player(fenetre1.donneNomJoueur());
Network.setProxy("srv-proxy-etu-2.iut-nantes.univ-nantes.prive", 3128);
Network.enableProxy(true);
/* Network.setProxy("srv-proxy-etu-2.iut-nantes.univ-nantes.prive", 3128);
Network.enableProxy(true);*/
try {
if (Network.suscribeNewPlayer("http://37.187.38.219/api/v0", player1)){
......
......@@ -67,10 +67,10 @@ public class ListenerBoutonJoin implements ActionListener {
if (test.contains(fenetre1.checkID())){
Network.joinGame("http://37.187.38.219/api/v0", JoinGame, fenetre1.getPlayerVues(), flotte2);
MenuJeu fenetre3 = new MenuJeu("Interface de jeu");
//fenetre3.EtatFlotte(false);
MenuJeu fenetre3 = new MenuJeu("Interface de jeu",fenetre1.getMaflotte());
fenetre3.setGame(JoinGame);
fenetre3.pack();
fenetre3.setMaflotte(flotte2);
fenetre3.setVisible(true);
fenetre1.dispose();
......
......@@ -46,8 +46,8 @@ public class ListenerClavierInscription implements KeyListener {
try {
Player player1 = new Player(fenetre1.donneNomJoueur());
Network.setProxy("srv-proxy-etu-2.iut-nantes.univ-nantes.prive", 3128);
Network.enableProxy(true);
/* Network.setProxy("srv-proxy-etu-2.iut-nantes.univ-nantes.prive", 3128);
Network.enableProxy(true);*/
if (Network.suscribeNewPlayer("http://37.187.38.219/api/v0", player1)){
MenuFlotte fenetre2 = new MenuFlotte("Selection de votre flotte");
fenetre2.pack();
......
......@@ -81,9 +81,8 @@ public class ListenerClavierJoin implements KeyListener {
if (test.contains(fenetre1.checkID())) {
Network.joinGame("http://37.187.38.219/api/v0", JoinGame, fenetre1.getPlayerVues(), flotte2);
MenuJeu fenetre3 = new MenuJeu("Interface de jeu");
//fenetre3.EtatFlotte(false);
fenetre3.setMaflotte(flotte2);
MenuJeu fenetre3 = new MenuJeu("Interface de jeu",fenetre1.getMaflotte());
fenetre3.setGame(JoinGame);
fenetre3.pack();
fenetre3.setVisible(true);
fenetre1.dispose();
......
......@@ -26,6 +26,7 @@ public class ListenerJouer implements ActionListener {
e.printStackTrace();
}
fenetre2.setMaflotte(fenetre.getMaflotte());
System.out.println(fenetre.getMaflotte());
fenetre2.pack();
fenetre2.setVisible(true);
fenetre2.ListenerBoutonJoin(new ListenerBoutonJoin(fenetre2));
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter