DEADSOFTWARE

Update version script
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / actions / updateblock / UpdateBedRightAction.kt
1 package ru.deadsoftware.cavedroid.game.actions.updateblock
3 import ru.deadsoftware.cavedroid.game.GameItemsHolder
4 import ru.deadsoftware.cavedroid.game.GameScope
5 import ru.deadsoftware.cavedroid.game.mobs.FallingGravel
6 import ru.deadsoftware.cavedroid.game.mobs.MobsController
7 import ru.deadsoftware.cavedroid.game.world.GameWorld
8 import javax.inject.Inject
10 @GameScope
11 class UpdateBedRightAction @Inject constructor(
12 private val gameWorld: GameWorld,
13 private val gameItemsHolder: GameItemsHolder,
14 ) : IUpdateBlockAction {
16 override fun update(x: Int, y: Int) {
17 val bedLeft = gameItemsHolder.getBlock("bed_l")
18 if (gameWorld.getForeMap(x - 1, y) != bedLeft) {
19 gameWorld.resetForeMap(x, y)
20 }
21 }
23 companion object {
24 const val BLOCK_KEY = "bed_r"
25 }
26 }