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
Alexandre Ducarne
ai12-othello
Commits
0428bdff
Commit
0428bdff
authored
Nov 27, 2019
by
Thomas
Browse files
Removed static reference call of GameCore in controllers
parent
32e8b62b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/client/ClientApp.java
View file @
0428bdff
...
...
@@ -22,7 +22,7 @@ public class ClientApp extends Application {
private
static
ComCoreClient
comCoreClient
;
private
static
DataCoreClient
dataCoreClient
;
public
static
MainCore
mainCore
;
p
ublic
static
GameCore
gameCore
;
p
rivate
static
GameCore
gameCore
;
public
static
final
String
APPLICATION_NAME
=
"Othello"
;
public
static
final
int
APPLICATION_WIDTH
=
889
;
public
static
final
int
APPLICATION_HEIGHT
=
500
;
...
...
src/main/java/client/game/GameCore.java
View file @
0428bdff
...
...
@@ -67,8 +67,10 @@ public class GameCore {
public
void
initializeFxStage
(
String
fxmlResource
,
Stage
stage
)
throws
IOException
{
fxStage
=
stage
;
FXMLLoader
fxmlLoader
=
new
FXMLLoader
(
getClass
().
getResource
(
fxmlResource
));
fxmlLoader
.
setControllerFactory
(
c
->
{
return
controller
;
});
BorderPane
root
=
(
BorderPane
)
fxmlLoader
.
load
();
Scene
scene
=
new
Scene
(
root
,
1200
,
800
);
scene
.
getStylesheets
().
add
(
"view/game.css"
);
...
...
src/main/java/client/game/controller/MainGameController.java
View file @
0428bdff
...
...
@@ -10,7 +10,6 @@ import javafx.scene.control.TextArea;
import
javafx.scene.control.Tooltip
;
import
javafx.scene.input.KeyCode
;
import
javafx.scene.input.KeyEvent
;
import
main.java.client.ClientApp
;
import
main.java.client.game.GameCore
;
import
main.java.common.dataModel.Message
;
...
...
@@ -75,15 +74,6 @@ public class MainGameController {
* Method called after the display of the game Java FX scene
*/
public
void
initialize
()
{
/*
* TODO: TEMPORARY FIX
*
* Another MainGameController is automatically created by JavaFX once the stage
* has been set using the related ihm game fxml file. Because of that, the
* current core is no longer set.
*/
setCore
(
ClientApp
.
gameCore
);
// Remove access to the chat panel if the game configuration says so
if
(!
gameCore
.
getDataToGame
().
isChatAuthorized
())
{
sideRightTabPane
.
getTabs
().
get
(
1
).
setDisable
(
true
);
...
...
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