Commit 23744b35 authored by Jolan RENOUX's avatar Jolan RENOUX
Browse files

maj vue3

parent affdd304
...@@ -10,6 +10,7 @@ import modele.info1.ships.NavyFleet; ...@@ -10,6 +10,7 @@ import modele.info1.ships.NavyFleet;
import vue.FenetreConnexion; import vue.FenetreConnexion;
import java.awt.*; import java.awt.*;
import java.lang.module.FindException;
import java.util.ArrayList; import java.util.ArrayList;
public class Application { public class Application {
...@@ -31,9 +32,13 @@ public class Application { ...@@ -31,9 +32,13 @@ public class Application {
*/ */
PremiereFenetre pf = new PremiereFenetre(); PremiereFenetre pf = new PremiereFenetre();
//connection au proxy
Network.setProxy(proxy,3128); Network.setProxy(proxy,3128);
Network.enableProxy(true); Network.enableProxy(true);
//TODO IHM changer le nom de jaquie //TODO IHM changer le nom de jaquie
Player jaquie = new Player("Jaquie"); Player jaquie = new Player("Jaquie");
try { try {
...@@ -49,11 +54,8 @@ public class Application { ...@@ -49,11 +54,8 @@ public class Application {
fleet.add(new AircraftCarrier("porteavion2","B1","B6")); fleet.add(new AircraftCarrier("porteavion2","B1","B6"));
fleet.add(new AircraftCarrier("porteavion3","C1","C6")); fleet.add(new AircraftCarrier("porteavion3","C1","C6"));
fleet.add(new AircraftCarrier("porteavion4","D1","D6")); fleet.add(new AircraftCarrier("porteavion4","D1","D6"));
} catch (BadCoordException e) {e.printStackTrace();} catch (CoordsBadShipException e) {e.printStackTrace();} } catch (BadCoordException | CoordsBadShipException e) {e.printStackTrace();}
while(fleet.isBelgianConfiguration() || fleet.isFrenchConfiguration()){ //while(!(pf.fc.getFlotte().remainingSize()==0)){}b
}
ArrayList<Game> parties = new ArrayList<Game>(); ArrayList<Game> parties = new ArrayList<Game>();
...@@ -84,7 +86,7 @@ public class Application { ...@@ -84,7 +86,7 @@ public class Application {
-100 si la partie est perdue par le joueur courant ; -100 si la partie est perdue par le joueur courant ;
-9999 sinon -9999 sinon
*/ */
/*
boolean partie_bool = true; boolean partie_bool = true;
int info; int info;
while(partie_bool){ while(partie_bool){
...@@ -123,7 +125,7 @@ public class Application { ...@@ -123,7 +125,7 @@ public class Application {
} }
Thread.sleep(500); Thread.sleep(500);
} }
*/
......
...@@ -5,7 +5,7 @@ import vue.FenetreConnexion; ...@@ -5,7 +5,7 @@ import vue.FenetreConnexion;
import java.awt.*; import java.awt.*;
public class PremiereFenetre { public class PremiereFenetre {
static FenetreConnexion fc = new FenetreConnexion("Connexion au serveur et aux parties"); public static FenetreConnexion fc = new FenetreConnexion("Connexion au serveur et aux parties");
public PremiereFenetre(){ public PremiereFenetre(){
fc.setPreferredSize(new Dimension(700, 700)); fc.setPreferredSize(new Dimension(700, 700));
......
package vue; package vue;
import PremiereFenetre.PremiereFenetre; import PremiereFenetre.PremiereFenetre;
import com.mashape.unirest.http.exceptions.UnirestException;
import info1.network.Game;
import info1.network.Network;
import info1.network.Player; import info1.network.Player;
import info1.ships.BadCoordException; import info1.ships.BadCoordException;
import info1.ships.CoordsBadShipException; import info1.ships.CoordsBadShipException;
...@@ -64,6 +67,7 @@ public class FenetreConnexion extends JFrame { ...@@ -64,6 +67,7 @@ public class FenetreConnexion extends JFrame {
grille.add(labellettre); grille.add(labellettre);
} }
int o = 0; int o = 0;
int j=0; int j=0;
int chiffre = 1; int chiffre = 1;
...@@ -204,6 +208,20 @@ public class FenetreConnexion extends JFrame { ...@@ -204,6 +208,20 @@ public class FenetreConnexion extends JFrame {
fJeux.setVisible(true); fJeux.setVisible(true);
} }
}); });
creerPartie.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
for (Game g : Network.listInitializedGames("http://37.187.38.219/api/v0")){
pInitialise.addItem(g);
}
} catch (UnirestException unirestException) {unirestException.printStackTrace(); }
}
});
france.addActionListener(new ActionListener() { france.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment