Class RgbTile
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.world.tiles.Tile
-
- page.codeberg.terratactician_expandoria.world.tiles.RgbTile
-
public class RgbTile extends Tile
A rgb tile can be used in creative mode, for visual purposes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile
Tile.TileType
-
-
Constructor Summary
Constructors Constructor Description RgbTile()
Creates a coordinate less rgb tile.RgbTile(CubeCoordinate coord)
Creates a rgb tile with coordinates.RgbTile(CubeCoordinate coord, org.json.JSONObject data)
Creates a rgb tiles with a coordinate and extra json meta data.RgbTile(RgbTile other)
Create a copy/clone of a house.
-
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.RgbTile
withBlue(int b)
Configure blue color channel value Will only be applied when placing the tile.RgbTile
withColors(int r, int g, int b)
RgbTile
withGreen(int g)
Configure green color channel value Will only be applied when placing the tile.RgbTile
withRed(int r)
Configure red color channel value Will only be applied when placing the tile.-
Methods inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile
deserialize, deserialize, getCoordinate, reclaimable, serialize, takeable, toString
-
-
-
-
Constructor Detail
-
RgbTile
public RgbTile()
Creates a coordinate less rgb tile.
-
RgbTile
public RgbTile(CubeCoordinate coord)
Creates a rgb tile with coordinates.- Parameters:
coord
- coordinate of the rgb tile
-
RgbTile
public RgbTile(RgbTile other)
Create a copy/clone of a house.- Parameters:
other
- tile to clone
-
RgbTile
public RgbTile(CubeCoordinate coord, org.json.JSONObject data)
Creates a rgb tiles with a coordinate and extra json meta data.- Parameters:
coord
- coordinate of the tiledata
- extra data
-
-
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.
-
withRed
public RgbTile withRed(int r)
Configure red color channel value Will only be applied when placing the tile. UseConfigureRgbTileAction
to change an existing tile.- Parameters:
r
- red color value [0,255]- Returns:
- reference to this
-
withGreen
public RgbTile withGreen(int g)
Configure green color channel value Will only be applied when placing the tile. UseConfigureRgbTileAction
to change an existing tile.- Parameters:
g
- green color value [0,255]- Returns:
- reference to this
-
withBlue
public RgbTile withBlue(int b)
Configure blue color channel value Will only be applied when placing the tile. UseConfigureRgbTileAction
to change an existing tile.- Parameters:
b
- blue color value [0,255]- Returns:
- reference to this
-
withColors
public RgbTile withColors(int r, int g, int b)
Short hand for.withRed(r)
.withGreen(g)
.withBlue(b)
; Will only be applied when placing the tile. UseConfigureRgbTileAction
to change an existing tile.- Parameters:
r
- red color value [0,255]g
- green color value [0,255]b
- blue color value [0,255]- Returns:
- reference to this
-
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
-
-