Class SoundTile


  • public class SoundTile
    extends Tile
    A Sound Tile can only be used in creative mode, to generate sound.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SoundTile.Wave
      A wave which is generated / played back by a Sound Tile
      • Nested classes/interfaces inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile

        Tile.TileType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float amplify
      Multiplied with output of sound tile
      boolean enabled
      Enable sound tile playback
      java.util.List<SoundTile.Wave> waves
      List of configured waves, that are played back by the sound tile
      • Fields inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile

        coord, reclaimTime
    • Constructor Summary

      Constructors 
      Constructor Description
      SoundTile()
      Creates a coordinate-less Sound Tile
      SoundTile​(CubeCoordinate coord)
      Creates a Sound Tile linked to the coordinate, with the default sound-tile-configuration
      SoundTile​(CubeCoordinate coord, java.util.List<SoundTile.Wave> waves, boolean enabled, float amplify)
      Creates a news Sound Tile with Data
      SoundTile​(SoundTile other)
      Creates a new Sound Tile, by copying a different tile
    • Field Detail

      • waves

        public java.util.List<SoundTile.Wave> waves
        List of configured waves, that are played back by the sound tile
      • enabled

        public boolean enabled
        Enable sound tile playback
      • amplify

        public float amplify
        Multiplied with output of sound tile
    • Constructor Detail

      • SoundTile

        public SoundTile()
        Creates a coordinate-less Sound Tile
      • SoundTile

        public SoundTile​(CubeCoordinate coord)
        Creates a Sound Tile linked to the coordinate, with the default sound-tile-configuration
        Parameters:
        coord - The coordinate where the tile should be placed / is placed
      • SoundTile

        public SoundTile​(CubeCoordinate coord,
                         java.util.List<SoundTile.Wave> waves,
                         boolean enabled,
                         float amplify)
        Creates a news Sound Tile with Data
        Parameters:
        coord - Coordinate of the targeted Sound tile
        waves - Soundwaves to be played back by the tile
        enabled - If the sound tile should produce sound
        amplify - Factor which is multiplied with Tile output
      • SoundTile

        public SoundTile​(SoundTile other)
        Creates a new Sound Tile, by copying a different tile
        Parameters:
        other - Sound Tile to copy data from
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from class: Tile
        Name of Tile in Api interface.
        Specified by:
        getName in class Tile
        Returns:
        api name of the tile
      • serializeData

        public org.json.JSONObject serializeData()
        Description copied from class: Tile
        Serializes extra Data of an Tile, to be send.
        Overrides:
        serializeData in class Tile
        Returns:
        null or JSONObject with at least a valid "type" field.
      • clone

        public Tile clone()
        Description copied from class: Tile
        Creates a clone of the tile.
        Specified by:
        clone in class Tile
        Returns:
        the new tile
      • dataToString

        public java.lang.String dataToString()
        Description copied from class: Tile
        Can be used by tile to add internal data to `toString`. Returned string should start with: ", "
        Overrides:
        dataToString in class Tile
        Returns:
        additional data stringified