get operator on Tile/ItemPropCodex

Former-commit-id: f6c4ecbad8c0ce2486524be70e68292d6aae799e
Former-commit-id: 9738a693eb55861d1292e59d8df2bec7f5603c40
This commit is contained in:
Song Minjae
2016-12-16 23:07:14 +09:00
parent 4552d7b7db
commit a5ca82f2c7
12 changed files with 65 additions and 63 deletions

View File

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