Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider b290f892 rédigé par Tristan MAISONNEUVE's avatar Tristan MAISONNEUVE
Parcourir les fichiers

Merge remote-tracking branch 'origin/master'

parents f9fc83a0 dafa39df
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="14" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" project-jdk-name="15" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
maquettes/Maquette début de partie.png

15,1 ko

Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
Fichier ajouté
Aucun aperçu pour ce type de fichier
......@@ -18,7 +18,7 @@ import java.util.ArrayList;
* @version 1.0
*/
public class Application {
public static void main(String[] args) throws InterruptedException, BadCoordException, CoordsBadShipException, UncompleteFleetException, UnirestException, BadIdException {
public static void main(String[] args) throws InterruptedException {
FenetreConnexion fc = new FenetreConnexion("Connexion au serveur et aux parties");
// http://172.26.82.18//api/v0 (URL à changer si ca ne marche pas)
......@@ -27,6 +27,9 @@ public class Application {
fc.pack();
fc.setVisible(true);
Network.setProxy("srv-proxy-etu-2.iut-nantes.univ-nantes.prive",3128);
Network.enableProxy(true);
//TODO IHM changer le nom de jaquie
Player jaquie = new Player("Jaquie");
try {
......@@ -37,10 +40,12 @@ public class Application {
//TODO Init fleet avec boucle listener ect
NavyFleet fleet = new NavyFleet();
fleet.add(new AircraftCarrier("porteavion1","A1","A6"));
fleet.add(new AircraftCarrier("porteavion2","B1","B6"));
fleet.add(new AircraftCarrier("porteavion3","C1","C6"));
fleet.add(new AircraftCarrier("porteavion4","D1","D6"));
try {
fleet.add(new AircraftCarrier("porteavion1","A1","A6"));
fleet.add(new AircraftCarrier("porteavion2","B1","B6"));
fleet.add(new AircraftCarrier("porteavion3","C1","C6"));
fleet.add(new AircraftCarrier("porteavion4","D1","D6"));
} catch (BadCoordException e) {e.printStackTrace();} catch (CoordsBadShipException e) {e.printStackTrace();}
ArrayList<Game> parties = new ArrayList<Game>();
......@@ -48,8 +53,12 @@ public class Application {
//TODO Init game ou rejoindre
Game newGame = new Game((int) Math.random());
Network.initNewGame("http://37.187.38.219/api/v0/",jaquie,fleet);
try {
Game newGame = new Game((int) Math.random());
} catch (BadIdException e) {e.printStackTrace();}
try {
Network.initNewGame("http://37.187.38.219/api/v0/",jaquie,fleet);
} catch (UnirestException e) {e.printStackTrace();} catch (UncompleteFleetException e) {e.printStackTrace();} catch (BadCoordException e) {e.printStackTrace();}
......
......@@ -8,6 +8,8 @@ import java.awt.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class FenetreConnexion extends JFrame {
private JTextField pseudo;
......@@ -75,7 +77,16 @@ public class FenetreConnexion extends JFrame {
zoneMessage.setPreferredSize(new Dimension(100,100));
bas.add(zoneMessage,BorderLayout.SOUTH);
rejoindre.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FenetreJeux fJeux = new FenetreJeux();
fJeux.setPreferredSize(new Dimension(700, 700));
fJeux.pack();
fJeux.setVisible(true);
}
});
principal.add(bas,BorderLayout.SOUTH);
......
package vue;
import javax.swing.*;
import java.awt.*;
public class FenetreJeux extends JFrame {
public FenetreJeux() {
super();
JPanel principal = new JPanel(new BorderLayout());
this.setContentPane(principal);
}
}
......@@ -21,8 +21,10 @@ import static org.junit.jupiter.api.Assertions.*;
*/
public class RunningGameTest {
//ancien url: http://37.187.38.219/api/v0
public static final String HTTP_LOCALHOST = "http://172.26.82.18//api/v0";
//http://37.187.38.219/api/v0
//http://172.26.82.18//api/v0
public static final String HTTP_LOCALHOST = "http://37.187.38.219/api/v0/";
static Player joueur1;
static Player joueur2;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter