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

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final String
    Input mapping name for mouse clicks.

    Von 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, showSettings

    Von 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 Typ
    Methode
    Beschreibung
    void
    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.Draw
    Returns the Draw instance used for rendering graphical elements in the game.
    Returns the executor service used for handling multithreaded tasks.
    pp.battleship.game.client.ClientGameLogic
    Returns the game logic handler for the client.
    static void
    main(String[] args)
    Starts the Battleship application.
    void
    receivedEvent(pp.battleship.notification.ClientStateEvent event)
    Handles client state events to update the game states accordingly.
    void
    receivedEvent(pp.battleship.notification.InfoTextEvent event)
    Updates the informational text in the GUI based on the key received in an InfoTextEvent.
    void
    requestClose(boolean esc)
    Handles a request to close the application.
    void
    Initializes the application.
    void
    simpleUpdate(float tpf)
    Updates the application state every frame.
    void
    stop(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, update

    Von 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, stop

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Von Schnittstelle geerbte Methoden pp.battleship.game.client.BattleshipClient

    enqueue

    Von Schnittstelle geerbte Methoden pp.battleship.notification.GameEventListener

    receivedEvent, receivedEvent, receivedEvent
  • Felddetails

  • Methodendetails

    • main

      public static void main(String[] args)
      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:
      getGameLogic in Schnittstelle pp.battleship.game.client.BattleshipClient
      Gibt zurück:
      The ClientGameLogic instance.
    • getConfig

      public BattleshipAppConfig getConfig()
      Returns the current configuration settings for the Battleship client.
      Angegeben von:
      getConfig in Schnittstelle pp.battleship.game.client.BattleshipClient
      Gibt zurück:
      The BattleshipClientConfig instance.
    • simpleInitApp

      public void simpleInitApp()
      Initializes the application. Sets up input mappings, GUI, game states, and connects to the server.
      Angegeben von:
      simpleInitApp in Klasse com.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:
      simpleUpdate in Klasse com.jme3.app.SimpleApplication
      Parameter:
      tpf - Time per frame in seconds.
    • getDraw

      public pp.graphics.Draw getDraw()
      Returns the Draw instance used for rendering graphical elements in the game.
      Gibt zurück:
      The Draw instance.
    • 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:
      requestClose in Schnittstelle com.jme3.system.SystemListener
      Setzt außer Kraft:
      requestClose in Klasse com.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 an InfoTextEvent.
      Angegeben von:
      receivedEvent in Schnittstelle pp.battleship.notification.GameEventListener
      Parameter:
      event - The InfoTextEvent containing 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:
      receivedEvent in Schnittstelle pp.battleship.notification.GameEventListener
      Parameter:
      event - The ClientStateEvent representing the state change.
    • getExecutor

      public ExecutorService getExecutor()
      Returns the executor service used for handling multithreaded tasks.
      Gibt zurück:
      The ExecutorService instance.
    • stop

      public void stop(boolean waitFor)
      Stops the application, shutting down the executor service and halting execution.
      Angegeben von:
      stop in Schnittstelle com.jme3.app.Application
      Setzt außer Kraft:
      stop in Klasse com.jme3.app.LegacyApplication
      Parameter:
      waitFor - If true, waits for the application to stop before returning.