Package pp.battleship.client
Klasse BattleshipApp
java.lang.Object
com.jme3.app.LegacyApplication
com.jme3.app.SimpleApplication
pp.battleship.client.BattleshipApp
- Alle implementierten Schnittstellen:
com.jme3.app.Application,com.jme3.system.SystemListener,pp.battleship.game.client.BattleshipClient,pp.battleship.notification.GameEventListener
public class BattleshipApp
extends com.jme3.app.SimpleApplication
implements pp.battleship.game.client.BattleshipClient, pp.battleship.notification.GameEventListener
The main class for the Battleship client application.
It manages the initialization, input setup, GUI setup, and game states for the client.
-
Feldübersicht
FelderVon Klasse geerbte Felder com.jme3.app.SimpleApplication
flyCam, fpsText, guiFont, guiNode, INPUT_MAPPING_CAMERA_POS, INPUT_MAPPING_EXIT, INPUT_MAPPING_HIDE_STATS, INPUT_MAPPING_MEMORY, rootNode, showSettingsVon Klasse geerbte Felder com.jme3.app.LegacyApplication
assetManager, audioRenderer, cam, context, guiViewPort, inputEnabled, inputManager, joyInput, keyInput, listener, lostFocusBehavior, mouseInput, paused, prof, renderer, renderManager, settings, speed, stateManager, timer, touchInput, viewPort -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidcloseApp()Closes the application, displaying a confirmation dialog if the client is connected to a server.Returns the current configuration settings for the Battleship client.pp.graphics.DrawgetDraw()Returns theDrawinstance used for rendering graphical elements in the game.Returns the executor service used for handling multithreaded tasks.pp.battleship.game.client.ClientGameLogicReturns the game logic handler for the client.static voidStarts the Battleship application.voidreceivedEvent(pp.battleship.notification.ClientStateEvent event) Handles client state events to update the game states accordingly.voidreceivedEvent(pp.battleship.notification.InfoTextEvent event) Updates the informational text in the GUI based on the key received in anInfoTextEvent.voidrequestClose(boolean esc) Handles a request to close the application.voidInitializes the application.voidsimpleUpdate(float tpf) Updates the application state every frame.voidstop(boolean waitFor) Stops the application, shutting down the executor service and halting execution.Von Klasse geerbte Methoden com.jme3.app.SimpleApplication
getFlyByCamera, getGuiNode, getRootNode, getSpeed, initialize, isShowSettings, loadGuiFont, setDisplayFps, setDisplayStatView, setShowSettings, setSpeed, simpleRender, start, updateVon Klasse geerbte Methoden com.jme3.app.LegacyApplication
createCanvas, destroy, destroyInput, enqueue, enqueue, gainFocus, getAppProfiler, getAssetManager, getAudioRenderer, getCamera, getContext, getGuiViewPort, getInputManager, getListener, getLostFocusBehavior, getRenderer, getRenderManager, getStateManager, getTimer, getViewPort, handleError, isPauseOnLostFocus, loseFocus, rescale, reshape, restart, runQueuedTasks, setAppProfiler, setAssetManager, setLostFocusBehavior, setPauseOnLostFocus, setSettings, setTimer, start, start, start, startCanvas, startCanvas, stopVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden pp.battleship.game.client.BattleshipClient
enqueueVon Schnittstelle geerbte Methoden pp.battleship.notification.GameEventListener
receivedEvent, receivedEvent, receivedEvent
-
Felddetails
-
CLICK
Input mapping name for mouse clicks.- Siehe auch:
-
-
Methodendetails
-
main
Starts the Battleship application.- Parameter:
args- Command-line arguments for launching the application.
-
getGameLogic
public pp.battleship.game.client.ClientGameLogic getGameLogic()Returns the game logic handler for the client.- Angegeben von:
getGameLogicin Schnittstellepp.battleship.game.client.BattleshipClient- Gibt zurück:
- The
ClientGameLogicinstance.
-
getConfig
Returns the current configuration settings for the Battleship client.- Angegeben von:
getConfigin Schnittstellepp.battleship.game.client.BattleshipClient- Gibt zurück:
- The
BattleshipClientConfiginstance.
-
simpleInitApp
public void simpleInitApp()Initializes the application. Sets up input mappings, GUI, game states, and connects to the server.- Angegeben von:
simpleInitAppin Klassecom.jme3.app.SimpleApplication
-
simpleUpdate
public void simpleUpdate(float tpf) Updates the application state every frame. This method is called once per frame during the game loop.- Setzt außer Kraft:
simpleUpdatein Klassecom.jme3.app.SimpleApplication- Parameter:
tpf- Time per frame in seconds.
-
getDraw
public pp.graphics.Draw getDraw()Returns theDrawinstance used for rendering graphical elements in the game.- Gibt zurück:
- The
Drawinstance.
-
requestClose
public void requestClose(boolean esc) Handles a request to close the application. If the request is initiated by pressing ESC, this parameter is true.- Angegeben von:
requestClosein Schnittstellecom.jme3.system.SystemListener- Setzt außer Kraft:
requestClosein Klassecom.jme3.app.LegacyApplication- Parameter:
esc- If true, the request is due to the ESC key being pressed.
-
closeApp
public void closeApp()Closes the application, displaying a confirmation dialog if the client is connected to a server. -
receivedEvent
public void receivedEvent(pp.battleship.notification.InfoTextEvent event) Updates the informational text in the GUI based on the key received in anInfoTextEvent.- Angegeben von:
receivedEventin Schnittstellepp.battleship.notification.GameEventListener- Parameter:
event- TheInfoTextEventcontaining the key for the text to display.
-
receivedEvent
public void receivedEvent(pp.battleship.notification.ClientStateEvent event) Handles client state events to update the game states accordingly.- Angegeben von:
receivedEventin Schnittstellepp.battleship.notification.GameEventListener- Parameter:
event- TheClientStateEventrepresenting the state change.
-
getExecutor
Returns the executor service used for handling multithreaded tasks.- Gibt zurück:
- The
ExecutorServiceinstance.
-
stop
public void stop(boolean waitFor) Stops the application, shutting down the executor service and halting execution.- Angegeben von:
stopin Schnittstellecom.jme3.app.Application- Setzt außer Kraft:
stopin Klassecom.jme3.app.LegacyApplication- Parameter:
waitFor- If true, waits for the application to stop before returning.
-