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;
import vue.FenetreConnexion;
import java.awt.*;
import java.lang.module.FindException;
import java.util.ArrayList;
public class Application {
......@@ -31,9 +32,13 @@ public class Application {
*/
PremiereFenetre pf = new PremiereFenetre();
//connection au proxy
Network.setProxy(proxy,3128);
Network.enableProxy(true);
//TODO IHM changer le nom de jaquie
Player jaquie = new Player("Jaquie");
try {
......@@ -49,11 +54,8 @@ public class Application {
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();}
while(fleet.isBelgianConfiguration() || fleet.isFrenchConfiguration()){
}
} catch (BadCoordException | CoordsBadShipException e) {e.printStackTrace();}
//while(!(pf.fc.getFlotte().remainingSize()==0)){}b
ArrayList<Game> parties = new ArrayList<Game>();
......@@ -84,7 +86,7 @@ public class Application {
-100 si la partie est perdue par le joueur courant ;
-9999 sinon
*/
/*
boolean partie_bool = true;
int info;
while(partie_bool){
......@@ -123,7 +125,7 @@ public class Application {
}
Thread.sleep(500);
}
*/
......
......@@ -5,7 +5,7 @@ import vue.FenetreConnexion;
import java.awt.*;
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(){
fc.setPreferredSize(new Dimension(700, 700));
......
package vue;
import PremiereFenetre.PremiereFenetre;
import com.mashape.unirest.http.exceptions.UnirestException;
import info1.network.Game;
import info1.network.Network;
import info1.network.Player;
import info1.ships.BadCoordException;
import info1.ships.CoordsBadShipException;
......@@ -64,6 +67,7 @@ public class FenetreConnexion extends JFrame {
grille.add(labellettre);
}
int o = 0;
int j=0;
int chiffre = 1;
......@@ -204,6 +208,20 @@ public class FenetreConnexion extends JFrame {
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() {
@Override
public void actionPerformed(ActionEvent e) {
......
Supports Markdown
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