diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/block/Block.kt b/core/src/ru/deadsoftware/cavedroid/game/model/block/Block.kt
index 2e268d046261913cefb1737b0d37bf51703ab198..fa99bfd91ed2afa2ed63221b23374ba221ad1baa 100644 (file)
return this is Slab
}
+ fun isContainer(): Boolean {
+ contract { returns(true) implies (this@Block is Container) }
+ return this is Container
+ }
+
fun isFurnace(): Boolean {
contract { returns(true) implies (this@Block is Furnace) }
return this is Furnace
}
+ fun isChest(): Boolean {
+ contract { returns(true) implies (this@Block is Chest) }
+ return this is Chest
+ }
+
fun isNone(): Boolean {
contract { returns(true) implies (this@Block is None) }
return this is None
)
}
+ sealed class Container() : Block()
+
data class None(
override val params: CommonBlockParams
) : Block()
data class Furnace(
override val params: CommonBlockParams,
- ): Block() {
+ ): Container() {
override val sprite: Sprite
get() = getSprite(false)
}
+ data class Chest(
+ override val params: CommonBlockParams
+ ): Container()
+
data class Slab(
override val params: CommonBlockParams,
val fullBlockKey: String,