From: fredboy Date: Tue, 14 May 2024 18:06:51 +0000 (+0700) Subject: Change generated modules package and move annotations X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=456e76ce31c05500ab7d9e78e2b02019143929a4;p=cavedroid.git Change generated modules package and move annotations --- diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameComponent.java b/core/src/ru/deadsoftware/cavedroid/game/GameComponent.java index 624e544..94d37d4 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameComponent.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameComponent.java @@ -2,13 +2,7 @@ package ru.deadsoftware.cavedroid.game; import dagger.Component; import ru.deadsoftware.cavedroid.MainComponent; -import ru.deadsoftware.cavedroid.game.actions.PlaceBlockActionsModule; -import ru.deadsoftware.cavedroid.game.actions.UpdateBlockActionsModule; -import ru.deadsoftware.cavedroid.game.actions.UseBlockActionsModule; -import ru.deadsoftware.cavedroid.game.actions.UseItemActionsModule; -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandlersModule; -import ru.deadsoftware.cavedroid.game.input.MouseInputHandlersModule; -import ru.deadsoftware.cavedroid.game.render.RenderModule; +import ru.deadsoftware.cavedroid.generated.module.*; @GameScope @Component(dependencies = MainComponent.class, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/IPlaceBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/IPlaceBlockAction.kt new file mode 100644 index 0000000..06c70c4 --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/IPlaceBlockAction.kt @@ -0,0 +1,9 @@ +package ru.deadsoftware.cavedroid.game.actions.placeblock + +import ru.deadsoftware.cavedroid.game.model.item.Item + +interface IPlaceBlockAction { + + fun place(placeable: Item.Placeable, x: Int, y: Int) + +} diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockAction.kt deleted file mode 100644 index e0f6cd8..0000000 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockAction.kt +++ /dev/null @@ -1,17 +0,0 @@ -package ru.deadsoftware.cavedroid.game.actions.placeblock - -import ru.deadsoftware.cavedroid.game.model.item.Item -import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule - -@GenerateMapMultibindingsModule( - interfaceClass = IPlaceBlockAction::class, - modulePackage = "ru.deadsoftware.cavedroid.game.actions", - moduleName = "PlaceBlockActionsModule" -) -annotation class PlaceBlockAction(val stringKey: String) - -interface IPlaceBlockAction { - - fun place(placeable: Item.Placeable, x: Int, y: Int) - -} diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToBackgroundAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToBackgroundAction.kt index 0a5399a..7258301 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToBackgroundAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToBackgroundAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindPlaceBlockAction import javax.inject.Inject @GameScope -@PlaceBlockAction(stringKey = PlaceBlockItemToBackgroundAction.ACTION_KEY) +@BindPlaceBlockAction(stringKey = PlaceBlockItemToBackgroundAction.ACTION_KEY) class PlaceBlockItemToBackgroundAction @Inject constructor( private val gameWorld: GameWorld, private val gameItemsHolder: GameItemsHolder, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToForegroundAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToForegroundAction.kt index d3ff979..ec249fb 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToForegroundAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceBlockItemToForegroundAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindPlaceBlockAction import javax.inject.Inject @GameScope -@PlaceBlockAction(stringKey = PlaceBlockItemToForegroundAction.ACTION_KEY) +@BindPlaceBlockAction(stringKey = PlaceBlockItemToForegroundAction.ACTION_KEY) class PlaceBlockItemToForegroundAction @Inject constructor( private val gameWorld: GameWorld, private val placeSlabAction: PlaceSlabAction, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceSlabAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceSlabAction.kt index 3e0a185..00c62d7 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceSlabAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/placeblock/PlaceSlabAction.kt @@ -6,10 +6,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindPlaceBlockAction import javax.inject.Inject @GameScope -@PlaceBlockAction(stringKey = PlaceSlabAction.ACTION_KEY) +@BindPlaceBlockAction(stringKey = PlaceSlabAction.ACTION_KEY) class PlaceSlabAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/IUpdateBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/IUpdateBlockAction.kt index a397f16..9cc4aea 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/IUpdateBlockAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/IUpdateBlockAction.kt @@ -1,14 +1,5 @@ package ru.deadsoftware.cavedroid.game.actions.updateblock -import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule - -@GenerateMapMultibindingsModule( - interfaceClass = IUpdateBlockAction::class, - modulePackage = "ru.deadsoftware.cavedroid.game.actions", - moduleName = "UpdateBlockActionsModule" -) -annotation class UpdateBlockAction(val stringKey: String) - interface IUpdateBlockAction { fun update(x: Int, y: Int) diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedLeftAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedLeftAction.kt index 4e43f8f..5507550 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedLeftAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedLeftAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.FallingGravel import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateBedLeftAction.BLOCK_KEY) +@BindUpdateBlockAction(stringKey = UpdateBedLeftAction.BLOCK_KEY) class UpdateBedLeftAction @Inject constructor( private val gameWorld: GameWorld, private val gameItemsHolder: GameItemsHolder, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedRightAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedRightAction.kt index 78e81fa..42f551e 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedRightAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateBedRightAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.FallingGravel import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateBedRightAction.BLOCK_KEY) +@BindUpdateBlockAction(stringKey = UpdateBedRightAction.BLOCK_KEY) class UpdateBedRightAction @Inject constructor( private val gameWorld: GameWorld, private val gameItemsHolder: GameItemsHolder, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGrassAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGrassAction.kt index 56f814f..476235a 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGrassAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGrassAction.kt @@ -3,10 +3,11 @@ package ru.deadsoftware.cavedroid.game.actions.updateblock import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateGrassAction.BLOCK_KEY) +@BindUpdateBlockAction(stringKey = UpdateGrassAction.BLOCK_KEY) class UpdateGrassAction @Inject constructor( private val gameWorld: GameWorld, private val mGameItemsHolder: GameItemsHolder, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGravelAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGravelAction.kt index f51bc7f..3c52418 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGravelAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateGravelAction.kt @@ -4,10 +4,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.FallingGravel import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateGravelAction.BLOCK_KEY) +@BindUpdateBlockAction(stringKey = UpdateGravelAction.BLOCK_KEY) class UpdateGravelAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateRequiresBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateRequiresBlockAction.kt index 6b15a7a..05d9863 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateRequiresBlockAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateRequiresBlockAction.kt @@ -2,10 +2,11 @@ package ru.deadsoftware.cavedroid.game.actions.updateblock import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateRequiresBlockAction.ACTION_KEY) +@BindUpdateBlockAction(stringKey = UpdateRequiresBlockAction.ACTION_KEY) class UpdateRequiresBlockAction @Inject constructor( private val gameWorld: GameWorld, ) : IUpdateBlockAction { diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSandAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSandAction.kt index f2ef25e..ac1ff8a 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSandAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSandAction.kt @@ -4,10 +4,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.FallingSand import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateSandAction.BLOCK_KEY) +@BindUpdateBlockAction(stringKey = UpdateSandAction.BLOCK_KEY) class UpdateSandAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSnowedGrassAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSnowedGrassAction.kt index 049c90b..2cf5a57 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSnowedGrassAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSnowedGrassAction.kt @@ -3,10 +3,11 @@ package ru.deadsoftware.cavedroid.game.actions.updateblock import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUpdateBlockAction import javax.inject.Inject @GameScope -@UpdateBlockAction(stringKey = UpdateSnowedGrassAction.BLOCK_KEY) +@BindUpdateBlockAction(stringKey = UpdateSnowedGrassAction.BLOCK_KEY) class UpdateSnowedGrassAction @Inject constructor( private val gameWorld: GameWorld, private val mGameItemsHolder: GameItemsHolder, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/IUseBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/IUseBlockAction.kt new file mode 100644 index 0000000..ddc70c5 --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/IUseBlockAction.kt @@ -0,0 +1,9 @@ +package ru.deadsoftware.cavedroid.game.actions.useblock + +import ru.deadsoftware.cavedroid.game.model.block.Block + +interface IUseBlockAction { + + fun perform(block: Block, x: Int, y: Int) + +} \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseBlockAction.kt deleted file mode 100644 index 932bbf6..0000000 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseBlockAction.kt +++ /dev/null @@ -1,17 +0,0 @@ -package ru.deadsoftware.cavedroid.game.actions.useblock - -import ru.deadsoftware.cavedroid.game.model.block.Block -import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule - -@GenerateMapMultibindingsModule( - interfaceClass = IUseBlockAction::class, - modulePackage = "ru.deadsoftware.cavedroid.game.actions", - moduleName = "UseBlockActionsModule" -) -annotation class UseBlockAction(val stringKey: String) - -interface IUseBlockAction { - - fun perform(block: Block, x: Int, y: Int) - -} \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseChestAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseChestAction.kt index fd370db..93684e7 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseChestAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseChestAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.model.block.Block import ru.deadsoftware.cavedroid.game.objects.container.Chest import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseBlockAction import javax.inject.Inject @GameScope -@UseBlockAction(stringKey = UseChestAction.KEY) +@BindUseBlockAction(stringKey = UseChestAction.KEY) class UseChestAction @Inject constructor( private val gameWorld: GameWorld, private val gameWindowsManager: GameWindowsManager, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseCraftingTableAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseCraftingTableAction.kt index de1112e..6d6c1e9 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseCraftingTableAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseCraftingTableAction.kt @@ -3,10 +3,11 @@ package ru.deadsoftware.cavedroid.game.actions.useblock import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.model.block.Block import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseBlockAction import javax.inject.Inject @GameScope -@UseBlockAction(stringKey = UseCraftingTableAction.KEY) +@BindUseBlockAction(stringKey = UseCraftingTableAction.KEY) class UseCraftingTableAction @Inject constructor( private val gameWindowsManager: GameWindowsManager ) : IUseBlockAction { diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseFurnaceAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseFurnaceAction.kt index 1426263..0b8ba53 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseFurnaceAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useblock/UseFurnaceAction.kt @@ -4,10 +4,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.model.block.Block import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseBlockAction import javax.inject.Inject @GameScope -@UseBlockAction(stringKey = UseFurnaceAction.KEY) +@BindUseBlockAction(stringKey = UseFurnaceAction.KEY) class UseFurnaceAction @Inject constructor( private val gameWorld: GameWorld, private val gameWindowsManager: GameWindowsManager, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/IUseItemAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/IUseItemAction.kt new file mode 100644 index 0000000..d963aee --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/IUseItemAction.kt @@ -0,0 +1,9 @@ +package ru.deadsoftware.cavedroid.game.actions.useitem + +import ru.deadsoftware.cavedroid.game.model.item.Item + +interface IUseItemAction { + + fun perform(item: Item.Usable, x: Int, y: Int) + +} \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseBedAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseBedAction.kt index 1aefd67..f48115e 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseBedAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseBedAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseItemAction import javax.inject.Inject @GameScope -@UseItemAction(UseBedAction.ACTION_KEY) +@BindUseItemAction(UseBedAction.ACTION_KEY) class UseBedAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, 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 fd64751..6992af7 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseEmptyBucketAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseEmptyBucketAction.kt @@ -6,10 +6,11 @@ import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.block.Block import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseItemAction import javax.inject.Inject @GameScope -@UseItemAction(UseEmptyBucketAction.ACTION_KEY) +@BindUseItemAction(UseEmptyBucketAction.ACTION_KEY) class UseEmptyBucketAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseItemAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseItemAction.kt deleted file mode 100644 index be4d254..0000000 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseItemAction.kt +++ /dev/null @@ -1,17 +0,0 @@ -package ru.deadsoftware.cavedroid.game.actions.useitem - -import ru.deadsoftware.cavedroid.game.model.item.Item -import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule - -@GenerateMapMultibindingsModule( - interfaceClass = IUseItemAction::class, - modulePackage = "ru.deadsoftware.cavedroid.game.actions", - moduleName = "UseItemActionsModule" -) -annotation class UseItemAction(val stringKey: String) - -interface IUseItemAction { - - fun perform(item: Item.Usable, x: Int, y: Int) - -} \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseLavaBucketAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseLavaBucketAction.kt index 70438e3..ec1e585 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseLavaBucketAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseLavaBucketAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseItemAction import javax.inject.Inject @GameScope -@UseItemAction(UseLavaBucketAction.ACTION_KEY) +@BindUseItemAction(UseLavaBucketAction.ACTION_KEY) class UseLavaBucketAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UsePigSpawnEggAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UsePigSpawnEggAction.kt index 4b2aa00..5eddc5e 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UsePigSpawnEggAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UsePigSpawnEggAction.kt @@ -5,11 +5,12 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.Pig import ru.deadsoftware.cavedroid.game.model.item.Item +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseItemAction import ru.deadsoftware.cavedroid.misc.utils.px import javax.inject.Inject @GameScope -@UseItemAction(UsePigSpawnEggAction.ACTION_KEY) +@BindUseItemAction(UsePigSpawnEggAction.ACTION_KEY) class UsePigSpawnEggAction @Inject constructor( private val mobsController: MobsController, private val gameItemsHolder: GameItemsHolder, diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseWaterBucketAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseWaterBucketAction.kt index 83b8f24..739ec28 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseWaterBucketAction.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/actions/useitem/UseWaterBucketAction.kt @@ -5,10 +5,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindUseItemAction import javax.inject.Inject @GameScope -@UseItemAction(UseWaterBucketAction.ACTION_KEY) +@BindUseItemAction(UseWaterBucketAction.ACTION_KEY) class UseWaterBucketAction @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/GameInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/IGameInputHandler.kt similarity index 60% rename from core/src/ru/deadsoftware/cavedroid/game/input/GameInputHandler.kt rename to core/src/ru/deadsoftware/cavedroid/game/input/IGameInputHandler.kt index 55dc618..2c5f118 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/GameInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/IGameInputHandler.kt @@ -3,21 +3,6 @@ package ru.deadsoftware.cavedroid.game.input import ru.deadsoftware.cavedroid.game.input.action.IGameInputAction import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction -import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule - -@GenerateSetMultibindingsModule( - interfaceClass = IKeyboardInputHandler::class, - modulePackage = "ru.deadsoftware.cavedroid.game.input", - moduleName = "KeyboardInputHandlersModule" -) -annotation class KeyboardInputHandler - -@GenerateSetMultibindingsModule( - interfaceClass = IMouseInputHandler::class, - modulePackage = "ru.deadsoftware.cavedroid.game.input", - moduleName = "MouseInputHandlersModule" -) -annotation class MouseInputHandler interface IKeyboardInputHandler : IGameInputHandler diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt index cbc254e..8bf9b1c 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt @@ -3,16 +3,16 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.objects.drop.DropController import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class CloseGameWindowKeyboardInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/DropItemKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/DropItemKeyboardInputHandler.kt index 01a0c1f..e9c8eb0 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/DropItemKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/DropItemKeyboardInputHandler.kt @@ -3,7 +3,6 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController @@ -11,10 +10,11 @@ import ru.deadsoftware.cavedroid.game.model.item.Item import ru.deadsoftware.cavedroid.game.objects.drop.Drop import ru.deadsoftware.cavedroid.game.objects.drop.DropController import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class DropItemKeyboardInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyDownKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyDownKeyboardInputHandler.kt index 8e41dfe..ae5f4c3 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyDownKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyDownKeyboardInputHandler.kt @@ -3,15 +3,15 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class FlyDownKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyUpKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyUpKeyboardInputHandler.kt index 976b069..444fe09 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyUpKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/FlyUpKeyboardInputHandler.kt @@ -3,15 +3,15 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class FlyUpKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoLeftKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoLeftKeyboardInputHandler.kt index 8234476..2b40d46 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoLeftKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoLeftKeyboardInputHandler.kt @@ -3,16 +3,16 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.Mob import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class GoLeftKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoRightKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoRightKeyboardInputHandler.kt index 3139a17..ec38218 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoRightKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/GoRightKeyboardInputHandler.kt @@ -3,16 +3,16 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.Mob import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class GoRightKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/JumpKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/JumpKeyboardInputHandler.kt index 30f12dd..bcacbf5 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/JumpKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/JumpKeyboardInputHandler.kt @@ -3,15 +3,15 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class JumpKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/MoveCursorControlsModeKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/MoveCursorControlsModeKeyboardInputHandler.kt index 98d3e0a..84c5b90 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/MoveCursorControlsModeKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/MoveCursorControlsModeKeyboardInputHandler.kt @@ -3,16 +3,16 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class MoveCursorControlsModeKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/OpenInventoryKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/OpenInventoryKeyboardInputHandler.kt index a1ca3da..70ae158 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/OpenInventoryKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/OpenInventoryKeyboardInputHandler.kt @@ -3,14 +3,14 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class OpenInventoryKeyboardInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, ) : IKeyboardInputHandler { diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/PauseGameKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/PauseGameKeyboardInputHandler.kt index e4d6707..cedc78a 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/PauseGameKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/PauseGameKeyboardInputHandler.kt @@ -5,7 +5,6 @@ import ru.deadsoftware.cavedroid.game.GameSaver import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController @@ -13,10 +12,11 @@ import ru.deadsoftware.cavedroid.game.objects.drop.DropController import ru.deadsoftware.cavedroid.game.objects.container.ContainerController import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class PauseGameKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val dropController: DropController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SelectHotbarSlotKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SelectHotbarSlotKeyboardInputHandler.kt index 0c7ea74..d22cd94 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SelectHotbarSlotKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SelectHotbarSlotKeyboardInputHandler.kt @@ -2,14 +2,14 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class SelectHotbarSlotKeyboardInputHandler @Inject constructor( private val mobsController: MobsController, ) : IKeyboardInputHandler { diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/StopSwimKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/StopSwimKeyboardInputHandler.kt index 7256c54..d8c5acc 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/StopSwimKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/StopSwimKeyboardInputHandler.kt @@ -3,16 +3,16 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class StopSwimKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SwimUpKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SwimUpKeyboardInputHandler.kt index 9dc4777..20cc82e 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SwimUpKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/SwimUpKeyboardInputHandler.kt @@ -3,16 +3,16 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class SwimUpKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleControlsModeKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleControlsModeKeyboardInputHandler.kt index a933c80..f8e0177 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleControlsModeKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleControlsModeKeyboardInputHandler.kt @@ -3,15 +3,15 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class ToggleControlsModeKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleDebugInfoKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleDebugInfoKeyboardInputHandler.kt index 065b28c..7cf08ed 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleDebugInfoKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleDebugInfoKeyboardInputHandler.kt @@ -3,13 +3,13 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class ToggleDebugInfoKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig ) : IKeyboardInputHandler { diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleGameModeKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleGameModeKeyboardInputHandler.kt index a17e6d2..64a1116 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleGameModeKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleGameModeKeyboardInputHandler.kt @@ -2,14 +2,14 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class ToggleGameModeKeyboardInputHandler @Inject constructor( private val mobsController: MobsController ) : IKeyboardInputHandler { diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleMinimapKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleMinimapKeyboardInputHandler.kt index 6f22e4c..2cd6638 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleMinimapKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/ToggleMinimapKeyboardInputHandler.kt @@ -3,13 +3,13 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class ToggleMinimapKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, ) : IKeyboardInputHandler { diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/TurnOnFlyModeKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/TurnOnFlyModeKeyboardInputHandler.kt index 3b43d31..43a7122 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/TurnOnFlyModeKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/TurnOnFlyModeKeyboardInputHandler.kt @@ -3,15 +3,15 @@ package ru.deadsoftware.cavedroid.game.input.handler.keyboard import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler -import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindKeyboardInputHandler import javax.inject.Inject @GameScope -@KeyboardInputHandler +@BindKeyboardInputHandler class TurnOnFlyModeKeyboardInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/AttackMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/AttackMouseInputHandler.kt index c2a22ed..52333eb 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/AttackMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/AttackMouseInputHandler.kt @@ -1,9 +1,9 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.input.isInsideHotbar @@ -13,7 +13,7 @@ import ru.deadsoftware.cavedroid.game.world.GameWorld import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class AttackMouseInputHandler @Inject constructor( private val mobsController: MobsController, private val gameWorld: GameWorld, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CloseGameWindowMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CloseGameWindowMouseInputHandler.kt index b5ff2c5..4fb0879 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CloseGameWindowMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CloseGameWindowMouseInputHandler.kt @@ -1,11 +1,11 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import com.badlogic.gdx.graphics.g2d.TextureRegion import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.input.isInsideWindow @@ -15,7 +15,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class CloseGameWindowMouseInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CreativeInventoryScrollMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CreativeInventoryScrollMouseInputHandler.kt index bf6ba37..8acdb7e 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CreativeInventoryScrollMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CreativeInventoryScrollMouseInputHandler.kt @@ -1,5 +1,6 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import com.badlogic.gdx.math.MathUtils import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameItemsHolder @@ -7,7 +8,6 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.input.isInsideWindow @@ -16,7 +16,7 @@ import javax.inject.Inject import kotlin.math.abs @GameScope -@MouseInputHandler +@BindMouseInputHandler class CreativeInventoryScrollMouseInputHandler @Inject constructor( private val mainConfig: MainConfig, private val gameWindowsManager: GameWindowsManager, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CursorMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CursorMouseInputHandler.kt index 5d5c79f..c1f2af5 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CursorMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/CursorMouseInputHandler.kt @@ -1,12 +1,12 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import com.badlogic.gdx.math.MathUtils import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.mobs.Mob @@ -23,7 +23,7 @@ import ru.deadsoftware.cavedroid.misc.utils.px import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class CursorMouseInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/HotbarMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/HotbarMouseInputHandler.kt index 45ae49b..6a66338 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/HotbarMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/HotbarMouseInputHandler.kt @@ -1,11 +1,11 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import com.badlogic.gdx.utils.Timer import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.input.handler.keyboard.DropItemKeyboardInputHandler.Companion.DROP_DISTANCE @@ -19,7 +19,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class HotbarMouseInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectChestInventoryItemMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectChestInventoryItemMouseInputHandler.kt index 3118e9f..62a4836 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectChestInventoryItemMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectChestInventoryItemMouseInputHandler.kt @@ -1,9 +1,9 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsConfigs @@ -13,7 +13,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class SelectChestInventoryItemMouseInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCraftingInventoryItemMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCraftingInventoryItemMouseInputHandler.kt index cc993c9..aefea54 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCraftingInventoryItemMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCraftingInventoryItemMouseInputHandler.kt @@ -1,9 +1,9 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsConfigs @@ -13,7 +13,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class SelectCraftingInventoryItemMouseInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCreativeInventoryItemMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCreativeInventoryItemMouseInputHandler.kt index 5c6975f..976f443 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCreativeInventoryItemMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectCreativeInventoryItemMouseInputHandler.kt @@ -1,11 +1,11 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.input.isInsideWindow @@ -15,7 +15,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class SelectCreativeInventoryItemMouseInputHandler @Inject constructor( private val gameItemsHolder: GameItemsHolder, private val gameWindowsManager: GameWindowsManager, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectFurnaceInventoryItemMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectFurnaceInventoryItemMouseInputHandler.kt index 164b0c1..eac8cfa 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectFurnaceInventoryItemMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectFurnaceInventoryItemMouseInputHandler.kt @@ -1,9 +1,9 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.item.InventoryItem.Companion.isNoneOrNull @@ -15,7 +15,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class SelectFurnaceInventoryItemMouseInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectSurvivalInventoryItemMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectSurvivalInventoryItemMouseInputHandler.kt index 9f25b9a..58687fc 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectSurvivalInventoryItemMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/SelectSurvivalInventoryItemMouseInputHandler.kt @@ -1,9 +1,9 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import ru.deadsoftware.cavedroid.game.GameItemsHolder import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsConfigs @@ -13,7 +13,7 @@ import ru.deadsoftware.cavedroid.misc.Assets import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class SelectSurvivalInventoryItemMouseInputHandler @Inject constructor( private val gameWindowsManager: GameWindowsManager, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/UseItemMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/UseItemMouseInputHandler.kt index c0ff332..541bba7 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/UseItemMouseInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/mouse/UseItemMouseInputHandler.kt @@ -1,5 +1,6 @@ package ru.deadsoftware.cavedroid.game.input.handler.mouse +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import com.badlogic.gdx.Gdx import com.badlogic.gdx.utils.Timer import ru.deadsoftware.cavedroid.game.GameScope @@ -10,7 +11,6 @@ import ru.deadsoftware.cavedroid.game.actions.placeblock.IPlaceBlockAction import ru.deadsoftware.cavedroid.game.actions.useblock.IUseBlockAction import ru.deadsoftware.cavedroid.game.actions.useitem.IUseItemAction import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler -import ru.deadsoftware.cavedroid.game.input.MouseInputHandler import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction import ru.deadsoftware.cavedroid.game.input.action.keys.MouseInputActionKey import ru.deadsoftware.cavedroid.game.input.isInsideHotbar @@ -21,7 +21,7 @@ import ru.deadsoftware.cavedroid.game.world.GameWorld import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class UseItemMouseInputHandler @Inject constructor( private val mobsController: MobsController, private val useItemActionMap: Map, diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/touch/JoystickInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/touch/JoystickInputHandler.kt index b6f31a3..d717c18 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/touch/JoystickInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/touch/JoystickInputHandler.kt @@ -1,5 +1,6 @@ package ru.deadsoftware.cavedroid.game.input.handler.touch +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindMouseInputHandler import com.badlogic.gdx.utils.TimeUtils import ru.deadsoftware.cavedroid.MainConfig import ru.deadsoftware.cavedroid.game.GameScope @@ -15,7 +16,7 @@ import ru.deadsoftware.cavedroid.game.world.GameWorld import javax.inject.Inject @GameScope -@MouseInputHandler +@BindMouseInputHandler class JoystickInputHandler @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/BackgroundBlocksRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/BackgroundBlocksRenderer.kt index e86450c..0d34540 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/BackgroundBlocksRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/BackgroundBlocksRenderer.kt @@ -8,11 +8,12 @@ import com.badlogic.gdx.math.Rectangle import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.forEachBlockInArea import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class BackgroundBlocksRenderer @Inject constructor( gameWorld: GameWorld, mobsController: MobsController diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/DebugRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/DebugRenderer.kt index d1a1d16..0fa2756 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/DebugRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/DebugRenderer.kt @@ -10,14 +10,15 @@ import ru.deadsoftware.cavedroid.game.debug.DebugInfoStringsProvider import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.model.block.Block import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.bl import ru.deadsoftware.cavedroid.misc.utils.drawString import ru.deadsoftware.cavedroid.misc.utils.forEachBlockInArea import ru.deadsoftware.cavedroid.misc.utils.px import javax.inject.Inject -@GameRenderer @GameScope +@BindRenderer class DebugRenderer @Inject constructor( private val mainConfig: MainConfig, private val gameWorld: GameWorld, diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/DropsRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/DropsRenderer.kt index 5e1da4a..d1fc65a 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/DropsRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/DropsRenderer.kt @@ -6,13 +6,14 @@ import com.badlogic.gdx.math.Rectangle import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.objects.drop.DropController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.cycledInsideWorld import ru.deadsoftware.cavedroid.misc.utils.drawSprite import ru.deadsoftware.cavedroid.misc.utils.px import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class DropsRenderer @Inject constructor( private val dropController: DropController, private val gameWorld: GameWorld, diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/ForegroundBlocksRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/ForegroundBlocksRenderer.kt index 0bb4001..8353b0b 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/ForegroundBlocksRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/ForegroundBlocksRenderer.kt @@ -6,11 +6,12 @@ import com.badlogic.gdx.math.Rectangle import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.forEachBlockInArea import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class ForegroundBlocksRenderer @Inject constructor( gameWorld: GameWorld, mobsController: MobsController diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/HudRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/HudRenderer.kt index cb70e16..b6b22ae 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/HudRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/HudRenderer.kt @@ -10,12 +10,13 @@ import ru.deadsoftware.cavedroid.game.mobs.player.Player.ControlMode import ru.deadsoftware.cavedroid.game.ui.TooltipManager import ru.deadsoftware.cavedroid.game.world.GameWorld import ru.deadsoftware.cavedroid.misc.Assets +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.drawString import ru.deadsoftware.cavedroid.misc.utils.px import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class HudRenderer @Inject constructor( private val gameWorld: GameWorld, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/GameRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/IGameRenderer.kt similarity index 61% rename from core/src/ru/deadsoftware/cavedroid/game/render/GameRenderer.kt rename to core/src/ru/deadsoftware/cavedroid/game/render/IGameRenderer.kt index c0ded1e..88b5744 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/GameRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/IGameRenderer.kt @@ -3,14 +3,6 @@ package ru.deadsoftware.cavedroid.game.render import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.glutils.ShapeRenderer import com.badlogic.gdx.math.Rectangle -import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule - -@GenerateSetMultibindingsModule( - interfaceClass = IGameRenderer::class, - modulePackage = "ru.deadsoftware.cavedroid.game.render", - moduleName = "RenderModule" -) -annotation class GameRenderer interface IGameRenderer { diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/MobsRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/MobsRenderer.kt index ab1dd01..52ac971 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/MobsRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/MobsRenderer.kt @@ -7,12 +7,13 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.mobs.Mob import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.world.GameWorld +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.cycledInsideWorld import ru.deadsoftware.cavedroid.misc.utils.px import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class MobsRenderer @Inject constructor( private val mobsController: MobsController, private val gameWorld: GameWorld, diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/TouchControlsRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/TouchControlsRenderer.kt index 29702ae..f2198aa 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/TouchControlsRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/TouchControlsRenderer.kt @@ -11,13 +11,14 @@ import ru.deadsoftware.cavedroid.game.mobs.MobsController import ru.deadsoftware.cavedroid.game.mobs.player.Player.ControlMode import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager import ru.deadsoftware.cavedroid.misc.Assets +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import ru.deadsoftware.cavedroid.misc.utils.ArrayMapExtensions.component1 import ru.deadsoftware.cavedroid.misc.utils.ArrayMapExtensions.component2 import ru.deadsoftware.cavedroid.misc.utils.drawSprite import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class TouchControlsRenderer @Inject constructor( private val mainConfig: MainConfig, private val mobsController: MobsController, diff --git a/core/src/ru/deadsoftware/cavedroid/game/render/WindowsRenderer.kt b/core/src/ru/deadsoftware/cavedroid/game/render/WindowsRenderer.kt index 4e65b41..945bb1e 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/render/WindowsRenderer.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/render/WindowsRenderer.kt @@ -8,10 +8,11 @@ import ru.deadsoftware.cavedroid.game.GameScope import ru.deadsoftware.cavedroid.game.GameUiWindow import ru.deadsoftware.cavedroid.game.render.windows.* import ru.deadsoftware.cavedroid.game.ui.windows.GameWindowsManager +import ru.deadsoftware.cavedroid.misc.annotations.multibinding.BindRenderer import javax.inject.Inject @GameScope -@GameRenderer +@BindRenderer class WindowsRenderer @Inject constructor( private val creativeWindowRenderer: CreativeWindowRenderer, private val survivalWindowRenderer: SurvivalWindowRenderer, diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindKeyboardInputHandler.kt new file mode 100644 index 0000000..004012d --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindKeyboardInputHandler.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler +import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule + +@GenerateSetMultibindingsModule( + interfaceClass = IKeyboardInputHandler::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "KeyboardInputHandlersModule" +) +annotation class BindKeyboardInputHandler \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindMouseInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindMouseInputHandler.kt new file mode 100644 index 0000000..02b934c --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindMouseInputHandler.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.input.IMouseInputHandler +import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule + +@GenerateSetMultibindingsModule( + interfaceClass = IMouseInputHandler::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "MouseInputHandlersModule" +) +annotation class BindMouseInputHandler \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindPlaceBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindPlaceBlockAction.kt new file mode 100644 index 0000000..779835f --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindPlaceBlockAction.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.actions.placeblock.IPlaceBlockAction +import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule + +@GenerateMapMultibindingsModule( + interfaceClass = IPlaceBlockAction::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "PlaceBlockActionsModule" +) +annotation class BindPlaceBlockAction(val stringKey: String) diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindRenderer.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindRenderer.kt new file mode 100644 index 0000000..ae994ea --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindRenderer.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.render.IGameRenderer +import ru.fredboy.cavedroid.ksp.annotations.GenerateSetMultibindingsModule + +@GenerateSetMultibindingsModule( + interfaceClass = IGameRenderer::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "RenderModule" +) +annotation class BindRenderer diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUpdateBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUpdateBlockAction.kt new file mode 100644 index 0000000..8665ec1 --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUpdateBlockAction.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.actions.updateblock.IUpdateBlockAction +import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule + +@GenerateMapMultibindingsModule( + interfaceClass = IUpdateBlockAction::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "UpdateBlockActionsModule" +) +annotation class BindUpdateBlockAction(val stringKey: String) \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUseBlockAction.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUseBlockAction.kt new file mode 100644 index 0000000..b34214d --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUseBlockAction.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.actions.useblock.IUseBlockAction +import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule + +@GenerateMapMultibindingsModule( + interfaceClass = IUseBlockAction::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "UseBlockActionsModule" +) +annotation class BindUseBlockAction(val stringKey: String) diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUseItemAction.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUseItemAction.kt new file mode 100644 index 0000000..de2c74f --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/BindUseItemAction.kt @@ -0,0 +1,11 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +import ru.deadsoftware.cavedroid.game.actions.useitem.IUseItemAction +import ru.fredboy.cavedroid.ksp.annotations.GenerateMapMultibindingsModule + +@GenerateMapMultibindingsModule( + interfaceClass = IUseItemAction::class, + modulePackage = MultibindingConfig.GENERATED_MODULES_PACKAGE, + moduleName = "UseItemActionsModule" +) +annotation class BindUseItemAction(val stringKey: String) diff --git a/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/MultibindingConfig.kt b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/MultibindingConfig.kt new file mode 100644 index 0000000..12427bd --- /dev/null +++ b/core/src/ru/deadsoftware/cavedroid/misc/annotations/multibinding/MultibindingConfig.kt @@ -0,0 +1,5 @@ +package ru.deadsoftware.cavedroid.misc.annotations.multibinding + +data object MultibindingConfig { + const val GENERATED_MODULES_PACKAGE = "ru.deadsoftware.cavedroid.generated.module" +} \ No newline at end of file