-
Notifications
You must be signed in to change notification settings - Fork 137
/
TileGrid.kt
48 lines (43 loc) · 1.56 KB
/
TileGrid.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
* that 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` that 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 TypingSupport
* @see UIEventSource
* @see ViewContainer
*/
interface TileGrid : AnimationRunner, Clearable, Closeable, DrawSurface, Layerable,
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
}