DEADSOFTWARE

Add top slabs
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / model / mapper / BlockMapper.kt
index cae219f00c053b679141776e2ec8a67b40395bf1..a122754caad73e972a6cb20f7155c6b76f02a9fd 100644 (file)
@@ -18,7 +18,7 @@ class BlockMapper @Inject constructor() {
         return when (dto.meta) {
             "water" -> Water(commonBlockParams, requireNotNull(dto.state))
             "lava" -> Lava(commonBlockParams, requireNotNull(dto.state))
-            "slab" -> Slab(commonBlockParams, requireNotNull(dto.fullBlock))
+            "slab" -> Slab(commonBlockParams, requireNotNull(dto.fullBlock), requireNotNull(dto.otherPart))
             "none" -> None(commonBlockParams)
             else -> Normal(commonBlockParams)
         }
@@ -41,7 +41,7 @@ class BlockMapper @Inject constructor() {
             isTransparent = dto.transparent,
             requiresBlock = dto.blockRequired,
             animationInfo = mapBlockAnimationInfo(dto),
-            texture = loadTexture(dto.texture),
+            texture = getTexture(dto.texture),
             spriteMargins = BlockMargins(
                 left = dto.spriteLeft,
                 top = dto.spriteTop,
@@ -75,7 +75,7 @@ class BlockMapper @Inject constructor() {
         )
     }
 
-    private fun loadTexture(textureName: String): Texture? {
+    private fun getTexture(textureName: String): Texture? {
         if (textureName == GameItemsHolder.FALLBACK_BLOCK_KEY) {
             return null
         }