Shape

interface Shape : Collection<Position>

A Shape is a set of org.hexworks.zircon.api.data.Positions representing a geometric formation (line, triangle, rectangle, box, etc). A Shape is the most abstract representation of any graphic object in Zircon and has no associated grid, style, nor characters thus it is useful for templating (like creating multiple versions of the same rectangle with different colors, shades and characters). Any Shape implementation is supposed to be immutable!

Functions

contains
Link copied to clipboard
common
abstract operator fun contains(element: Position): Boolean
containsAll
Link copied to clipboard
common
abstract fun containsAll(elements: Collection<Position>): Boolean
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
isEmpty
Link copied to clipboard
common
abstract fun isEmpty(): Boolean
iterator
Link copied to clipboard
common
abstract operator override fun iterator(): Iterator<Position>
offsetToDefaultPosition
Link copied to clipboard
common
abstract fun offsetToDefaultPosition(): Shape
Offsets this Shape to the default position (column=0,row=0), so offsetting a Shape which contains (Position(2, 3), Position(3, 4)) will be transformed to ((Position(0, 0), Position(1, 1)).
plus
Link copied to clipboard
common
open operator fun plus(shape: Shape): Shape
Combines two Shapes into a new one which means that this operation creates an union of the Positions of both Shapes.
toString
Link copied to clipboard
common
open fun toString(): String
toTileGraphics
Link copied to clipboard
common
abstract fun toTileGraphics(tile: Tile, tileset: TilesetResource): TileGraphics
Creates a TileGraphics from this Shape using tile to fill the positions.

Properties

positions
Link copied to clipboard
common
abstract val positions: Set<Position>
All the Positions this Shape contains.
size
Link copied to clipboard
common
abstract val size: Int

Inheritors

DefaultShape
Link copied to clipboard

Sources

(source)
Link copied to clipboard