new gem on worldgen

This commit is contained in:
minjaesong
2024-02-13 23:42:43 +09:00
parent 6e1af36a63
commit e5ac560966
27 changed files with 263 additions and 82 deletions

View File

@@ -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)
}