Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
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
adab4705
Commit
adab4705
authored
Jun 24, 2021
by
Jolan RENOUX
Browse files
maj vue9
parent
b046a86a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Application.java
View file @
adab4705
...
...
@@ -8,6 +8,7 @@ import modele.info1.ships.AircraftCarrier;
import
modele.info1.ships.Coord
;
import
modele.info1.ships.NavyFleet
;
import
vue.FenetreConnexion
;
import
vue.FenetreJeux
;
import
java.awt.*
;
import
java.lang.module.FindException
;
...
...
@@ -53,12 +54,13 @@ public class Application {
while
(
pf
.
fc
.
isValider
()){
Thread
.
sleep
(
500
);}
jaquie
=
new
Player
(
pf
.
fc
.
getPseudo
());
fleet
=
pf
.
fc
.
getFlotte
();
ArrayList
<
Game
>
parties
=
new
ArrayList
<
Game
>();
//TODO IHM : combobox avec cette liste
//TODO Init game ou rejoindre
//new game
try
{
...
...
@@ -97,9 +99,8 @@ public class Application {
break
;
case
10
:
System
.
out
.
println
(
"10 c'est au joueur courant de jouer"
);
//TODO CORD_LISTENER avec un listener
//TODO comprendre où récupérer player2
//Network.playOneTurn("http://172.26.82.18//api/v0", GAME, jaquie, CORD_LISTENER);
while
(
FenetreJeux
.
getCoco
()
!=
null
)
Network
.
playOneTurn
(
"http://172.26.82.18//api/v0"
,
GAME
,
jaquie
,
FenetreJeux
.
getCoco
());
break
;
case
-
10
:
System
.
out
.
println
(
"-10 ce n'est pas au joueur courant de jouer"
);
...
...
src/vue/FenetreConnexion.java
View file @
adab4705
...
...
@@ -215,14 +215,32 @@ public class FenetreConnexion extends JFrame {
principal
.
add
(
est
,
BorderLayout
.
EAST
);
rejoindre
.
addActionListener
(
e
->
{
PremiereFenetre
.
close
();
//PremiereFenetre.close();
FenetreJeux
fJeux
=
new
FenetreJeux
(
"yolo"
);
fJeux
.
setPreferredSize
(
new
Dimension
(
700
,
700
));
fJeux
.
pack
();
fJeux
.
setVisible
(
true
);
rejoindre
.
addActionListener
(
e
->
{
});
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
();
}
}
});
pInitialise
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
...
...
@@ -243,19 +261,6 @@ public class FenetreConnexion extends JFrame {
}
});
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
)
{
...
...
src/vue/FenetreJeux.java
View file @
adab4705
...
...
@@ -18,14 +18,14 @@ import java.awt.event.ActionListener;
import
java.util.List
;
public
class
FenetreJeux
extends
JFrame
{
private
Coord
coco
;
private
static
Coord
coco
;
//création de la classe Fenetre jeux extension de JFrame
private
JComboBox
pInitialise
;
//initialisation de tout les widget
private
JButton
rejoindre
;
private
JButton
creerPartie
;
//initialisation de tout les widget
private
JTextArea
zoneMessage
;
public
FenetreJeux
(
String
titre
){
//constructeur
super
(
titre
);
...
...
@@ -112,6 +112,6 @@ public class FenetreJeux extends JFrame {
//qu'on ajoute au panel principale
}
public
Coord
getCoco
()
{
return
coco
;}
public
static
Coord
getCoco
()
{
return
coco
;}
}
Write
Preview
Supports
Markdown
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