Class SoundTile
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.world.tiles.Tile
-
- page.codeberg.terratactician_expandoria.world.tiles.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 tileboolean
enabled
Enable sound tile playbackjava.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 TileSoundTile(CubeCoordinate coord)
Creates a Sound Tile linked to the coordinate, with the default sound-tile-configurationSoundTile(CubeCoordinate coord, java.util.List<SoundTile.Wave> waves, boolean enabled, float amplify)
Creates a news Sound Tile with DataSoundTile(SoundTile other)
Creates a new Sound Tile, by copying a different tile
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tile
clone()
Creates a clone of the tile.java.lang.String
dataToString()
Can be used by tile to add internal data to `toString`.java.lang.String
getName()
Name of Tile in Api interface.org.json.JSONObject
serializeData()
Serializes extra Data of an Tile, to be send.-
Methods inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile
deserialize, deserialize, getCoordinate, getTileType, reclaimable, serialize, takeable, toString
-
-
-
-
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 tilewaves
- Soundwaves to be played back by the tileenabled
- If the sound tile should produce soundamplify
- 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.
-
serializeData
public org.json.JSONObject serializeData()
Description copied from class:Tile
Serializes extra Data of an Tile, to be send.- Overrides:
serializeData
in classTile
- Returns:
- null or JSONObject with at least a valid "type" field.
-
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 classTile
- Returns:
- additional data stringified
-
-