diff --git a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt index 9b6b98408..691bf688a 100644 --- a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt +++ b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt @@ -50,7 +50,7 @@ open class ActorWithBody : Actor { * * NOTE: MUST NOT SERIALISE (use `@Transient`) */ - open var lightBoxList: List = emptyList() + open var lightBoxList: ArrayList = arrayListOf() // must use ArrayList: has no-arg constructor /** * Arguments: @@ -60,7 +60,7 @@ open class ActorWithBody : Actor { * * NOTE: MUST NOT SERIALISE (use `@Transient`) */ - open var shadeBoxList: List = emptyList() + open var shadeBoxList: ArrayList = arrayListOf() // must use ArrayList: has no-arg constructor // end of Luminous protected constructor() : super() diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt index 4ebaf1391..e36a1e3dc 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/ActorHumanoid.kt @@ -99,9 +99,9 @@ open class ActorHumanoid : ActorWithBody, Controllable, Pocketed, Factionable, L * Hitbox(x-offset, y-offset, width, height) * (Use ArrayList for normal circumstances) */ - @Transient override var lightBoxList: List = listOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0))) + @Transient override var lightBoxList: ArrayList = arrayListOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0))) // the actual values are update on the update() - @Transient override var shadeBoxList: List = listOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0))) + @Transient override var shadeBoxList: ArrayList = arrayListOf(Lightbox(Hitbox(2.0, 2.0, baseHitboxW - 3.0, baseHitboxH - 3.0), Cvec(0))) // the actual values are update on the update() @Transient val BASE_DENSITY = 980.0 diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt index 7d7a67e10..8af9f698e 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/DroppedItem.kt @@ -39,9 +39,9 @@ open class DroppedItem : ActorWithBody { private val randKey1 = (Math.random() * 256).toInt() private val randKey2 = (Math.random() * 256).toInt() - override var lightBoxList = listOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0))) + override var lightBoxList = arrayListOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0))) // the Cvec will be calculated dynamically on Update - override var shadeBoxList = listOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0))) + override var shadeBoxList = arrayListOf(Lightbox(this.hitbox.clone().setPosition(0.0, 0.0), Cvec(0))) // the Cvec will be calculated dynamically on Update /** diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt index 6ef2887c8..fc7ba12a8 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt @@ -43,9 +43,9 @@ open class FixtureSwingingDoorBase : FixtureBase { private var pixelwiseHitboxHeight = TILE_SIZE * tilewiseHitboxHeight private var tilewiseDistToAxis = tw - twClosed - @Transient override var lightBoxList = listOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0))) + @Transient override var lightBoxList = arrayListOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0))) // the Cvec will be calculated dynamically on Update - @Transient override var shadeBoxList = listOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0))) + @Transient override var shadeBoxList = arrayListOf(Lightbox(Hitbox(TILE_SIZED * tilewiseDistToAxis, 0.0, TILE_SIZED * twClosed, TILE_SIZED * th), Cvec(0))) // the Cvec will be calculated dynamically on Update protected var doorState = 0 // -1: open toward left, 0: closed, 1: open toward right diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureTikiTorch.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureTikiTorch.kt index f77fac44b..47e634dfa 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureTikiTorch.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureTikiTorch.kt @@ -23,7 +23,7 @@ internal class FixtureTikiTorch : FixtureBase { private val rndHash1 = (Math.random() * 256).toInt() private val rndHash2 = (Math.random() * 256).toInt() - @Transient override var lightBoxList = listOf(Lightbox(Hitbox(6.0, 5.0, 4.0, 3.0), BlockCodex[Block.TORCH].getLumCol(rndHash1, rndHash2))) + @Transient override var lightBoxList = arrayListOf(Lightbox(Hitbox(6.0, 5.0, 4.0, 3.0), BlockCodex[Block.TORCH].getLumCol(rndHash1, rndHash2))) constructor() : super( BlockBox(BlockBox.NO_COLLISION, 1, 2), diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/ProjectileSimple.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/ProjectileSimple.kt index 20f832dac..77f7fb52e 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/ProjectileSimple.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/ProjectileSimple.kt @@ -39,7 +39,7 @@ open class ProjectileSimple : ActorWithBody, Projectile { * Hitbox(x-offset, y-offset, width, height) * (Use ArrayList for normal circumstances) */ - @Transient override var lightBoxList = listOf(Lightbox(Hitbox(-4.0, -4.0, 8.0, 8.0), color)) // lightbox sized 8x8 centered to the bullet + @Transient override var lightBoxList = arrayListOf(Lightbox(Hitbox(-4.0, -4.0, 8.0, 8.0), color)) // lightbox sized 8x8 centered to the bullet private val lifetimeMax = 2500