mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
get operator on Tile/ItemPropCodex
Former-commit-id: f6c4ecbad8c0ce2486524be70e68292d6aae799e Former-commit-id: 9738a693eb55861d1292e59d8df2bec7f5603c40
This commit is contained in:
@@ -206,13 +206,13 @@ object WorldSimulator {
|
||||
}
|
||||
}
|
||||
|
||||
fun Int.isFluid() = TilePropCodex.getProp(this).isFluid
|
||||
fun Int.isSolid() = this.fluidLevel() == FLUID_MAX || TilePropCodex.getProp(this).isSolid
|
||||
//fun Int.viscosity() = TilePropCodex.getProp(this).
|
||||
fun Int.isFluid() = TilePropCodex[this].isFluid
|
||||
fun Int.isSolid() = this.fluidLevel() == FLUID_MAX || TilePropCodex[this].isSolid
|
||||
//fun Int.viscosity() = TilePropCodex[this].
|
||||
fun Int.fluidLevel() = if (!this.isFluid()) 0 else (this % FLUID_MAX) + 1
|
||||
fun Int.fluidType() = this / FLUID_MAX
|
||||
fun Int.isEven() = (this and 0x01) == 0
|
||||
fun Int.isFallable() = TilePropCodex.getProp(this).isFallable
|
||||
fun Int.isFallable() = TilePropCodex[this].isFallable
|
||||
|
||||
private fun placeFluid(world: GameWorld, x: Int, y: Int, fluidType: Byte, amount: Int) {
|
||||
if (world.layerTerrain.isInBound(x, y)) {
|
||||
|
||||
Reference in New Issue
Block a user