Class 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int b
      blue color value
      int g
      green color value
      int r
      red color value
      • Fields inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile

        coord, reclaimTime
    • 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.
    • Field Detail

      • r

        public int r
        red color value
      • g

        public int g
        green color value
      • b

        public int b
        blue color value
    • 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 tile
        data - extra data
    • 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
      • withRed

        public RgbTile withRed​(int r)
        Configure red color channel value Will only be applied when placing the tile. Use ConfigureRgbTileAction 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. Use ConfigureRgbTileAction 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. Use ConfigureRgbTileAction 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. Use ConfigureRgbTileAction 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 class Tile
        Returns:
        additional data stringified