From: fredboy Date: Thu, 9 May 2024 11:51:47 +0000 (+0700) Subject: Fix warnings X-Git-Tag: alpha0.9.0~8 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=450a8c72dc2d2ed039b4974b8e9be598b81c07e6;p=cavedroid.git Fix warnings --- diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseEmptyBucketAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseEmptyBucketAction.kt index 9f7c9f4..57ca3f7 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseEmptyBucketAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseEmptyBucketAction.kt @@ -22,6 +22,7 @@ class UseEmptyBucketAction @Inject constructor( } gameWorld.resetForeMap(x, y) + @Suppress("REDUNDANT_ELSE_IN_WHEN") val filled = when (foregroundBlock) { is Block.Lava -> gameItemsHolder.getItem("bucket_lava") is Block.Water -> gameItemsHolder.getItem("bucket_water") diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/player/Inventory.kt b/core/src/ru/deadsoftware/cavedroid/game/mobs/player/Inventory.kt index d99a90e..8ce9592 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/mobs/player/Inventory.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/mobs/player/Inventory.kt @@ -14,9 +14,11 @@ class Inventory( tooltipManager: TooltipManager, ) : Serializable { + @Suppress("UNNECESSARY_LATEINIT") @Transient private lateinit var tooltipManager: TooltipManager + @Suppress("UNNECESSARY_LATEINIT") @Transient private lateinit var fallbackItem: InventoryItem diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/block/CommonBlockParams.kt b/core/src/ru/deadsoftware/cavedroid/game/model/block/CommonBlockParams.kt index e98f1be..369f752 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/block/CommonBlockParams.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/block/CommonBlockParams.kt @@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Texture import ru.deadsoftware.cavedroid.game.model.item.Item data class CommonBlockParams( - @Deprecated("numeric id's will be removed") val id: Int?, val key: String, val collisionMargins: BlockMargins, val hitPoints: Int, diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/dto/BlockDto.kt b/core/src/ru/deadsoftware/cavedroid/game/model/dto/BlockDto.kt index c6065b7..69b1f18 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/dto/BlockDto.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/dto/BlockDto.kt @@ -5,7 +5,6 @@ import kotlinx.serialization.Serializable @Serializable data class BlockDto( - @Deprecated("numeric ids will be removed") @SerialName("id") val id: Int? = null, @SerialName("left") val left: Int = 0, @SerialName("top") val top: Int = 0, @SerialName("right") val right: Int = 0, diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/dto/ItemDto.kt b/core/src/ru/deadsoftware/cavedroid/game/model/dto/ItemDto.kt index fe28e64..f3c0544 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/dto/ItemDto.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/dto/ItemDto.kt @@ -5,7 +5,6 @@ import kotlinx.serialization.Serializable @Serializable data class ItemDto( - @Deprecated("numeric ids will be removed") @SerialName("id") val id: Int? = null, @SerialName("name") val name: String, @SerialName("type") val type: String = "normal", @SerialName("texture") val texture: String, diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/item/CommonItemParams.kt b/core/src/ru/deadsoftware/cavedroid/game/model/item/CommonItemParams.kt index 291cfb8..0330a36 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/item/CommonItemParams.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/item/CommonItemParams.kt @@ -3,7 +3,6 @@ package ru.deadsoftware.cavedroid.game.model.item import ru.deadsoftware.cavedroid.misc.utils.SpriteOrigin data class CommonItemParams( - @Deprecated("numeric id's will be removed") val id: Int?, val key: String, val name: String, val inHandSpriteOrigin: SpriteOrigin, diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/mapper/BlockMapper.kt b/core/src/ru/deadsoftware/cavedroid/game/model/mapper/BlockMapper.kt index 85d8cb7..f45451f 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/mapper/BlockMapper.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/mapper/BlockMapper.kt @@ -30,7 +30,6 @@ class BlockMapper @Inject constructor( private fun mapCommonParams(key: String, dto: BlockDto): CommonBlockParams { return CommonBlockParams( - id = dto.id, key = key, collisionMargins = BlockMargins( left = dto.left, diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/mapper/ItemMapper.kt b/core/src/ru/deadsoftware/cavedroid/game/model/mapper/ItemMapper.kt index b951f26..4557cc8 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/model/mapper/ItemMapper.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/model/mapper/ItemMapper.kt @@ -38,7 +38,6 @@ class ItemMapper @Inject constructor( private fun mapCommonParams(key: String, dto: ItemDto): CommonItemParams { return CommonItemParams( - id = dto.id, key = key, name = dto.name, inHandSpriteOrigin = SpriteOrigin( diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/Drop.kt b/core/src/ru/deadsoftware/cavedroid/game/objects/Drop.kt index b6f21bb..f67c66c 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/objects/Drop.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/objects/Drop.kt @@ -17,6 +17,7 @@ class Drop @JvmOverloads constructor( val velocity = getInitialVelocity() var pickedUp = false + @Suppress("UNNECESSARY_LATEINIT") @Transient lateinit var item: Item private set