package ru.dbotthepony.kstarbound.world.api

import ru.dbotthepony.kommons.util.IStruct2i
import ru.dbotthepony.kstarbound.world.physics.CollisionType
import ru.dbotthepony.kstarbound.world.physics.CollisionTypeGetter

// for getting tiles directly, avoiding manual layer specification
interface ITileAccess : ICellAccess, CollisionTypeGetter {
	// relative
	fun getTile(x: Int, y: Int): AbstractTileState
	fun getTile(pos: IStruct2i) = getTile(pos.component1(), pos.component2())

	override fun collisionType(x: Int, y: Int): CollisionType {
		return getTile(x, y).material.value.collisionKind
	}
}
