Class MainGameScene
- java.lang.Object
-
- ch.sahits.game.openpatrician.javafx.OpenPatricianScene
-
- ch.sahits.game.openpatrician.display.scene.MainGameScene
-
public class MainGameScene extends OpenPatricianScene
-
-
Field Summary
Fields Modifier and Type Field Description private MainGameSceneBackground
background
private static int
BORDER_SPACING
Width/height of the border.private com.google.common.eventbus.AsyncEventBus
clientServerEventBus
private IJavaFXControlLoader
controlLoader
private javafx.scene.Group
foreground
private GameStatus
gameStatus
private static int
HORIZONTAL_DECO_HEIGHT
Height of the horizontal fries.(package private) static int
LEFT_PANEL_WIDTH
Width og the left panels inclusive borders.private static int
LEFT_STATUS_PANEL_WIDTH
Width of the left panels (without borders).private MainGameView
mainGameView
private static int
MAP_OVERVIEW_HEIGHT
Height of the map overview.(package private) static int
MENU_HEIGHT
Height of the menu bar.private MiniMap
miniMap
(package private) static int
MINMIMAL_DISPLAY_HEIGHT
The minimal height the display must have(package private) static int
NOTICE_HEIGHT
Height of the notice view.(package private) static int
TOP_STATUS_HEIGHT
Height of the top status bar.private ViewStatus
viewStatus
-
Constructor Summary
Constructors Constructor Description MainGameScene(double width, double height, IImageLoader loader, IJavaFXControlLoader controlLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
calculateMainGameViewHeight(double height)
private double
calculateMainGameViewWidth(double width)
void
heightChange(double oldHeight, double newHeigth)
Method that is called when the height of the scene changes.private void
initializeEventSystem()
void
initializeGameView(NewGameClient newGameDTO)
Event handler for initializing the new game when the server is done.private void
unregister()
void
widthChange(double oldWidth, double newWidth)
Method that is called when the width of the scene changes.
-
-
-
Field Detail
-
MAP_OVERVIEW_HEIGHT
private static final int MAP_OVERVIEW_HEIGHT
Height of the map overview.- See Also:
- Constant Field Values
-
LEFT_STATUS_PANEL_WIDTH
private static final int LEFT_STATUS_PANEL_WIDTH
Width of the left panels (without borders).- See Also:
- Constant Field Values
-
TOP_STATUS_HEIGHT
static final int TOP_STATUS_HEIGHT
Height of the top status bar.- See Also:
- Constant Field Values
-
BORDER_SPACING
private static final int BORDER_SPACING
Width/height of the border.- See Also:
- Constant Field Values
-
HORIZONTAL_DECO_HEIGHT
private static final int HORIZONTAL_DECO_HEIGHT
Height of the horizontal fries.- See Also:
- Constant Field Values
-
MENU_HEIGHT
static final int MENU_HEIGHT
Height of the menu bar.- See Also:
- Constant Field Values
-
NOTICE_HEIGHT
static final int NOTICE_HEIGHT
Height of the notice view.- See Also:
- Constant Field Values
-
LEFT_PANEL_WIDTH
static final int LEFT_PANEL_WIDTH
Width og the left panels inclusive borders.- See Also:
- Constant Field Values
-
MINMIMAL_DISPLAY_HEIGHT
static final int MINMIMAL_DISPLAY_HEIGHT
The minimal height the display must have- See Also:
- Constant Field Values
-
background
private MainGameSceneBackground background
-
gameStatus
private GameStatus gameStatus
-
viewStatus
private ViewStatus viewStatus
-
mainGameView
private MainGameView mainGameView
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
controlLoader
private IJavaFXControlLoader controlLoader
-
foreground
private javafx.scene.Group foreground
-
miniMap
private final MiniMap miniMap
-
-
Constructor Detail
-
MainGameScene
public MainGameScene(double width, double height, IImageLoader loader, IJavaFXControlLoader controlLoader)
-
-
Method Detail
-
initializeEventSystem
@PostConstruct private void initializeEventSystem()
-
unregister
@PreDestroy private void unregister()
-
initializeGameView
public void initializeGameView(NewGameClient newGameDTO)
Event handler for initializing the new game when the server is done.- Parameters:
newGameDTO
- data transfer object.
-
calculateMainGameViewHeight
private double calculateMainGameViewHeight(double height)
-
calculateMainGameViewWidth
private double calculateMainGameViewWidth(double width)
-
widthChange
public void widthChange(double oldWidth, double newWidth)
Description copied from class:OpenPatricianScene
Method that is called when the width of the scene changes. Subclasses that need to be aware of size changes should override this method.- Overrides:
widthChange
in classOpenPatricianScene
- Parameters:
oldWidth
- old width of the scenenewWidth
- new width of the scene
-
heightChange
public void heightChange(double oldHeight, double newHeigth)
Description copied from class:OpenPatricianScene
Method that is called when the height of the scene changes. Subclasses that need to be aware of size changes should override this method.- Overrides:
heightChange
in classOpenPatricianScene
- Parameters:
oldHeight
- old height of the scenenewHeigth
- new height of the scene
-
-