Commit 5e35d737 authored by Jolan RENOUX's avatar Jolan RENOUX
Browse files

maj app5

parent 531c1b39
import com.mashape.unirest.http.exceptions.UnirestException;
import info1.network.*;
import info1.ships.BadCoordException;
import info1.ships.CoordsBadShipException;
import info1.ships.UncompleteFleetException;
import modele.info1.ships.AircraftCarrier;
import modele.info1.ships.Coord;
import modele.info1.ships.NavyFleet;
import vue.FenetreConnexion;
import java.awt.*;
......@@ -13,7 +18,7 @@ import java.util.ArrayList;
* @version 1.0
*/
public class Application {
public static void main(String[] args) throws InterruptedException {
public static void main(String[] args) throws InterruptedException, BadCoordException, CoordsBadShipException, UncompleteFleetException, UnirestException, BadIdException {
FenetreConnexion test = new FenetreConnexion("Connexion au serveur et aux parties");
// http://172.26.82.18//api/v0 (URL à changer si ca ne marche pas)
......@@ -22,20 +27,32 @@ public class Application {
test.setVisible(true);
//TODO IHM changer le nom de jaquie
/* Player jaquie = new Player("Jaquie");
Player jaquie = new Player("Jaquie");
try {
Network.suscribeNewPlayer("http://37.187.38.219/api/v0/", jaquie);
} catch (UnirestException e) {
e.printStackTrace();
}
//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"));
ArrayList<Game> parties = new ArrayList<Game>();
//TODO IHM : combobox avec cette liste
//TODO IHM Listener : récupérer info partie↑
//TODO Init game soit de nous soit rejoindre
//TODO Init fleet avec boucle listener ect
//TODO Init game ou rejoindre
Game newGame = new Game((int) Math.random());
Network.initNewGame("http://37.187.38.219/api/v0/",jaquie,fleet);
......@@ -53,7 +70,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){
......@@ -91,7 +108,7 @@ public class Application {
break;
}
Thread.sleep(500);
} */
}
......
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