Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tristan MAISONNEUVE
projetS2-2021-23-LJ
Commits
23744b35
Commit
23744b35
authored
Jun 23, 2021
by
Jolan RENOUX
Browse files
maj vue3
parent
affdd304
Changes
7
Show whitespace changes
Inline
Side-by-side
out/production/battleship-student-project-2021/Application.class
View file @
23744b35
No preview for this file type
out/production/battleship-student-project-2021/modele/info1/ships/Ship.class
View file @
23744b35
No preview for this file type
out/production/battleship-student-project-2021/vue/FenetreConnexion.class
View file @
23744b35
No preview for this file type
out/production/battleship-student-project-2021/vue/FenetreJeux.class
View file @
23744b35
No preview for this file type
src/Application.java
View file @
23744b35
...
...
@@ -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
);
}
*/
...
...
src/PremiereFenetre/PremiereFenetre.java
View file @
23744b35
...
...
@@ -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
));
...
...
src/vue/FenetreConnexion.java
View file @
23744b35
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment