mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
new gem on worldgen
This commit is contained in:
@@ -7,9 +7,15 @@ import com.badlogic.gdx.utils.Disposable
|
||||
*/
|
||||
interface BlockLayer : Disposable {
|
||||
|
||||
val width: Int
|
||||
val height: Int
|
||||
val bytesPerBlock: Long
|
||||
fun unsafeToBytes(x: Int, y: Int): ByteArray
|
||||
fun unsafeSetTile(x: Int, y: Int, bytes: ByteArray)
|
||||
fun unsafeGetTile(x: Int, y: Int): Int
|
||||
|
||||
}
|
||||
|
||||
inline fun BlockLayer.getOffset(x: Int, y: Int): Long {
|
||||
return this.bytesPerBlock * (y * this.width + x)
|
||||
}
|
||||
Reference in New Issue
Block a user