Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (44 sloc)
1.6 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hexworks.zircon.api.grid | |
import org.hexworks.zircon.api.animation.AnimationRunner | |
import org.hexworks.zircon.api.behavior.* | |
import org.hexworks.zircon.api.data.Tile | |
import org.hexworks.zircon.api.graphics.DrawSurface | |
import org.hexworks.zircon.api.graphics.Layer | |
import org.hexworks.zircon.api.uievent.UIEventSource | |
import org.hexworks.zircon.api.view.ViewContainer | |
import org.hexworks.zircon.internal.grid.InternalTileGrid | |
/** | |
* The [TileGrid] is the most fundamental interface in Zircon. | |
* It is an abstraction which lets you manage a 2D grid composed of [Tile]s. | |
* It also supports layering, cursor handling, character printing, event handling, | |
* simple [Tile] drawing operations and many more. | |
* | |
* You can consider a [TileGrid] as an easy to use **facade** for all of your tile grid | |
* needs. | |
* | |
* **Note That** all [TileGrid]s have a [Layer] at index `0` which is used | |
* for implementing the [DrawSurface] operations and it can't be removed from the grid. | |
* | |
* In short all [TileGrid]s have at least **one** [Layer] in them. | |
* | |
* @see AnimationRunner | |
* @see Clearable | |
* @see Closeable | |
* @see DrawSurface | |
* @see Layerable | |
* @see ShutdownHook | |
* @see TypingSupport | |
* @see UIEventSource | |
* @see ViewContainer | |
*/ | |
interface TileGrid : AnimationRunner, Clearable, Closeable, DrawSurface, Layerable, | |
ShutdownHook, TypingSupport, UIEventSource, ViewContainer { | |
val widthInPixels: Int | |
get() = tileset.width * width | |
val heightInPixels: Int | |
get() = tileset.height * height | |
/** | |
* Exposes the internal API of this [TileGrid] | |
*/ | |
fun asInternal(): InternalTileGrid | |
} |