Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin DRUAULT-AUBIN
lo23-project
Commits
bc17e379
Commit
bc17e379
authored
Dec 19, 2017
by
Audrick Libraire
Browse files
[ihm-main] remove useless variable in createGameController
parent
d9b2d782
Changes
1
Hide whitespace changes
Inline
Side-by-side
Battleship/src/main/java/com/utclo23/ihmmain/controller/CreateGameController.java
View file @
bc17e379
...
...
@@ -5,7 +5,6 @@
*/
package
com.utclo23.ihmmain.controller
;
import
com.utclo23.data.module.DataException
;
import
com.utclo23.data.structure.Game
;
import
com.utclo23.data.structure.GameType
;
import
java.io.IOException
;
import
javafx.event.ActionEvent
;
...
...
@@ -16,7 +15,6 @@ import javafx.scene.control.RadioButton;
import
javafx.scene.control.TextField
;
import
javafx.scene.control.ToggleGroup
;
import
javafx.scene.image.ImageView
;
import
javax.swing.JOptionPane
;
/**
* Controll of the createGame page.
...
...
@@ -26,40 +24,31 @@ import javax.swing.JOptionPane;
public
class
CreateGameController
extends
AbstractController
{
ToggleGroup
mode
;
ToggleGroup
enemy
;
@FXML
RadioButton
radioButtonClassical
;
@FXML
RadioButton
radioButtonBelge
;
@FXML
RadioButton
radioButtonComputer
;
@FXML
RadioButton
radioButtonPlayer
;
@FXML
CheckBox
radioButtonAudience
;
@FXML
CheckBox
radioButtonChat
;
@FXML
TextField
gameNameField
;
@FXML
private
ImageView
avatarImageView
;
@FXML
private
Label
playerUsernameLabel
;
@FXML
private
ImageView
avatarImageView
;
@FXML
private
Label
playerUsernameLabel
;
/**
* This function is called at the oppening of the page.
* It affects default values to Mode and Enemy and create the toggle groups
*/
@FXML
public
void
initialize
(){
// Toggle Group
mode
=
new
ToggleGroup
();
...
...
@@ -101,15 +90,13 @@ public class CreateGameController extends AbstractController{
private
void
validateCreateGame
(
ActionEvent
event
){
String
names
=
gameNameField
.
getText
();
gameNameField
.
setStyle
(
""
);
JOptionPane
msg
=
new
JOptionPane
();
if
(!
names
.
isEmpty
()){
GameType
modes
=
(((
RadioButton
)
mode
.
getSelectedToggle
()).
getText
()).
equals
(
"CLASSIC"
)
?
GameType
.
CLASSIC
:
GameType
.
BELGIAN
;
boolean
enemys
=
(((
RadioButton
)
enemy
.
getSelectedToggle
()).
getText
()).
equals
(
"Computer"
);
boolean
chats
=
radioButtonChat
.
isSelected
();
boolean
audiences
=
radioButtonAudience
.
isSelected
();
try
{
Game
newGame
=
getFacade
().
iDataIHMMain
.
createGame
(
names
,
enemys
,
audiences
,
chats
,
modes
);
//msg.showMessageDialog(null, "Game created", "Information", JOptionPane.INFORMATION_MESSAGE);
getFacade
().
iDataIHMMain
.
createGame
(
names
,
enemys
,
audiences
,
chats
,
modes
);
getFacade
().
iIHMTableToIHMMain
.
createInGameGUI
(
getIhmmain
().
primaryStage
);
}
catch
(
DataException
e
){
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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