summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 76a3b56)
raw | patch | inline | side by side (parent: 76a3b56)
author | fredboy <fredboy@protonmail.com> | |
Tue, 21 May 2024 19:51:38 +0000 (02:51 +0700) | ||
committer | fredboy <fredboy@protonmail.com> | |
Tue, 21 May 2024 19:51:38 +0000 (02:51 +0700) |
diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingBlock.kt b/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingBlock.kt
index 77e51a1b189ecc2a4757a5b79f0be7dcff331117..d4494a30b5ae531f141a3b4fc7b13ef729590e76 100644 (file)
y: Float,
) : Mob(x, y, 1.px, 1.px, Direction.RIGHT, Type.FALLING_BLOCK, Int.MAX_VALUE) {
- @Transient
private var _block: Block? = null
init {
diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/Mob.java b/core/src/ru/deadsoftware/cavedroid/game/mobs/Mob.java
index 0f3610b61c36d0d516c744d7158abfa348a5fbd5..5d18755c590feb3ebbf9df3071cc96a32da8fa66 100644 (file)
import ru.deadsoftware.cavedroid.game.GameItemsHolder;
import ru.deadsoftware.cavedroid.game.model.dto.SaveDataDto;
import ru.deadsoftware.cavedroid.game.model.item.InventoryItem;
-import ru.deadsoftware.cavedroid.game.model.item.Item;
import ru.deadsoftware.cavedroid.game.world.GameWorld;
import ru.deadsoftware.cavedroid.misc.Saveable;
import javax.annotation.CheckForNull;
-import java.io.Serializable;
import java.util.Collections;
import java.util.List;
/**
* Mob class.
*/
-public abstract class Mob extends Rectangle implements Serializable, Saveable {
+public abstract class Mob extends Rectangle implements Saveable {
private static final float DAMAGE_TINT_TIMEOUT_S = 0.5f;
private static final Color DAMAGE_TINT_COLOR = new Color(0xff8080ff);
protected int mMaxHealth;
protected int mHealth;
- private transient boolean mTakingDamage = false;
- @CheckForNull private transient ResetTakeDamageTask mResetTakeDamageTask = null;
+ private boolean mTakingDamage = false;
+ @CheckForNull private ResetTakeDamageTask mResetTakeDamageTask = null;
/**
* @param x in pixels
diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/MobsController.kt b/core/src/ru/deadsoftware/cavedroid/game/mobs/MobsController.kt
index dc01e1e8e238db085a53a467edd52c6801bd634c..4b2c209c22d6fe1dc44fc4e65b04e1bca4bbae7e 100644 (file)
import ru.deadsoftware.cavedroid.game.model.dto.SaveDataDto
import ru.deadsoftware.cavedroid.game.ui.TooltipManager
import ru.deadsoftware.cavedroid.misc.Saveable
-import java.io.Serializable
import java.util.*
import javax.inject.Inject
class MobsController @Inject constructor(
gameItemsHolder: GameItemsHolder,
tooltipManager: TooltipManager,
-) : Serializable, Saveable {
+) : Saveable {
private val _mobs = LinkedList<Mob>()
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 8f0b90d721a709f3b5c2015d16d82c943ae1e779..91e8be1eac228aef5d181af5f636fb090df730d9 100644 (file)
import ru.deadsoftware.cavedroid.game.objects.drop.Drop
import ru.deadsoftware.cavedroid.game.ui.TooltipManager
import ru.deadsoftware.cavedroid.misc.Saveable
-import java.io.Serializable
class Inventory @JvmOverloads constructor(
val size: Int,
gameItemsHolder: GameItemsHolder,
tooltipManager: TooltipManager,
initialItems: List<InventoryItem>? = null
-) : Serializable, Saveable {
+) : Saveable {
@Suppress("UNNECESSARY_LATEINIT")
- @Transient
private lateinit var tooltipManager: TooltipManager
@Suppress("UNNECESSARY_LATEINIT")
- @Transient
private lateinit var fallbackItem: InventoryItem
private val _items: Array<InventoryItem>
diff --git a/core/src/ru/deadsoftware/cavedroid/game/model/item/InventoryItem.kt b/core/src/ru/deadsoftware/cavedroid/game/model/item/InventoryItem.kt
index 71909880fde87171235d4e665c39ca1f4837fad2..f420120b2844e7bd2d77ae4d01513837bac80c74 100644 (file)
import ru.deadsoftware.cavedroid.misc.utils.drawSprite
import ru.deadsoftware.cavedroid.misc.utils.drawString
import ru.deadsoftware.cavedroid.misc.utils.px
-import java.io.Serializable
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
class InventoryItem @JvmOverloads constructor(
val itemKey: String,
_amount: Int = 1,
-) : Serializable, Saveable {
+) : Saveable {
var amount = _amount
set(value) {
}
}
- @Transient
private var _item: Item? = null
var item: Item
diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/container/Container.kt b/core/src/ru/deadsoftware/cavedroid/game/objects/container/Container.kt
index 05ec7444fd79243e9ebbd35d129de5d668dd2f85..624f5d0c16865c17984ced324d48d99576624782 100644 (file)
import ru.deadsoftware.cavedroid.game.model.dto.SaveDataDto
import ru.deadsoftware.cavedroid.game.model.item.InventoryItem
import ru.deadsoftware.cavedroid.misc.Saveable
-import java.io.Serializable
import javax.annotation.OverridingMethodsMustInvokeSuper
abstract class Container @JvmOverloads constructor(
val size: Int,
gameItemsHolder: GameItemsHolder,
initialItems: List<InventoryItem>? = null,
-) : Serializable, Saveable {
+) : Saveable {
private val _items = Array(size) { index ->
initialItems?.getOrNull(index) ?: gameItemsHolder.fallbackItem.toInventoryItem()
diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/container/ContainerController.kt b/core/src/ru/deadsoftware/cavedroid/game/objects/container/ContainerController.kt
index bffb846d6116ef42439a8032e156ea19fb393e23..d2159f1cf72f3498016b8c457395e96c5f20b5ca 100644 (file)
import ru.deadsoftware.cavedroid.game.objects.drop.DropController
import ru.deadsoftware.cavedroid.misc.Saveable
import ru.deadsoftware.cavedroid.misc.utils.px
-import java.io.Serializable
import javax.inject.Inject
@GameScope
class ContainerController @Inject constructor(
_dropController: DropController,
_gameItemsHolder: GameItemsHolder
-) : Serializable, Saveable {
+) : Saveable {
@Suppress("UNNECESSARY_LATEINIT")
- @Transient
private lateinit var dropController: DropController
@Suppress("UNNECESSARY_LATEINIT")
- @Transient
private lateinit var gameItemsHolder: GameItemsHolder
private val containerMap = mutableMapOf<String, Container>()
diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/container/Furnace.kt b/core/src/ru/deadsoftware/cavedroid/game/objects/container/Furnace.kt
index 92eeab9eae5dcb239746a19c66e7139fd0e54ca9..237006dc6959626ec939bcc81f12ed2826d8245a 100644 (file)
val isActive: Boolean get() = currentFuel != null
- @Transient
var currentFuel: Item? = null
set(value) {
currentFuelKey = value?.params?.key
diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/drop/Drop.kt b/core/src/ru/deadsoftware/cavedroid/game/objects/drop/Drop.kt
index 548c44a5bbfb7a12fa0237dfa56d94cc2402d8a4..2b4f7409cd4b16fac15c121913b66151f436e483 100644 (file)
var pickedUp = false
@Suppress("UNNECESSARY_LATEINIT")
- @Transient
lateinit var item: Item
private set
diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java b/core/src/ru/deadsoftware/cavedroid/game/objects/drop/DropController.java
index f8299139a2723cf9565b56670b74f4fef0ad7e82..7b99676cbaabd769a88549959f7ac05e748dafcb 100644 (file)
import ru.deadsoftware.cavedroid.misc.Saveable;
import javax.inject.Inject;
-import java.io.Serializable;
import java.util.Iterator;
import java.util.LinkedList;
@GameScope
-public class DropController implements Serializable, Saveable {
+public class DropController implements Saveable {
private static final int SAVE_DATA_VERSION = 1;