Klasse GameSound

java.lang.Object
com.jme3.app.state.AbstractAppState
pp.battleship.client.GameSound
Alle implementierten Schnittstellen:
com.jme3.app.state.AppState, pp.battleship.notification.GameEventListener

public class GameSound extends com.jme3.app.state.AbstractAppState implements pp.battleship.notification.GameEventListener
An application state that plays sounds.
  • Feldübersicht

    Von Klasse geerbte Felder com.jme3.app.state.AbstractAppState

    initialized
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static boolean
    Checks if sound is enabled in the preferences.
    void
    Plays the explosion sound effect.
    void
    initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app)
    Initializes the sound effects for the game.
    void
    receivedEvent(pp.battleship.notification.SoundEvent event)
     
    void
    setEnabled(boolean enabled)
    Sets the enabled state of this AppState.
    void
    Plays sound effect when a ship has been destroyed.
    void
    Plays the splash sound effect.
    void
    Toggles the game sound on or off.

    Von Klasse geerbte Methoden com.jme3.app.state.AbstractAppState

    cleanup, getId, isEnabled, isInitialized, postRender, render, setId, stateAttached, stateDetached, update

    Von Klasse geerbte Methoden java.lang.Object

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

    Von Schnittstelle geerbte Methoden pp.battleship.notification.GameEventListener

    receivedEvent, receivedEvent, receivedEvent, receivedEvent
  • Konstruktordetails

    • GameSound

      public GameSound()
  • Methodendetails

    • enabledInPreferences

      public static boolean enabledInPreferences()
      Checks if sound is enabled in the preferences.
      Gibt zurück:
      true if sound is enabled, false otherwise.
    • toggleSound

      public void toggleSound()
      Toggles the game sound on or off.
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets the enabled state of this AppState. Overrides AbstractAppState.setEnabled(boolean)
      Angegeben von:
      setEnabled in Schnittstelle com.jme3.app.state.AppState
      Setzt außer Kraft:
      setEnabled in Klasse com.jme3.app.state.AbstractAppState
      Parameter:
      enabled - true to enable the AppState, false to disable it.
    • initialize

      public void initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app)
      Initializes the sound effects for the game. Overrides AbstractAppState.initialize(AppStateManager, Application)
      Angegeben von:
      initialize in Schnittstelle com.jme3.app.state.AppState
      Setzt außer Kraft:
      initialize in Klasse com.jme3.app.state.AbstractAppState
      Parameter:
      stateManager - The state manager
      app - The application
    • splash

      public void splash()
      Plays the splash sound effect.
    • explosion

      public void explosion()
      Plays the explosion sound effect.
    • shipDestroyed

      public void shipDestroyed()
      Plays sound effect when a ship has been destroyed.
    • receivedEvent

      public void receivedEvent(pp.battleship.notification.SoundEvent event)
      Angegeben von:
      receivedEvent in Schnittstelle pp.battleship.notification.GameEventListener