From a061fb258f3781a644a5433feccb1e427c778354 Mon Sep 17 00:00:00 2001 From: hundun Date: Sat, 21 Oct 2023 21:52:35 +0800 Subject: [PATCH] doChangeEpoch workable --- .../gdxgame/idledemo/DemoChildGameConfig.java | 4 +- ...emoIdleGame.java => IdleMushroomGame.java} | 56 +++++++++++++++++-- .../logic/DemoBuiltinConstructionsLoader.java | 1 + .../idledemo/logic/DemoGameDictionary.java | 14 ++++- .../idledemo/logic/DemoSaveHandler.java | 5 +- .../prototype/EpochCounterPrototype.java | 8 ++- .../ui/achievement/AchievementPopupBoard.java | 4 +- .../MainScreenConstructionControlBoard.java | 5 +- .../ui/screen/BaseDemoPlayScreen.java | 12 ++-- .../ui/screen/DemoAchievementScreen.java | 8 +-- .../idledemo/ui/screen/DemoMenuScreen.java | 6 +- .../idledemo/ui/screen/DemoScreenContext.java | 8 +-- .../idledemo/ui/screen/MainPlayScreen.java | 17 ++---- .../idledemo/ui/screen/WorldPlayScreen.java | 4 +- .../ui/shared/ConstructionDetailPartVM.java | 6 +- .../ui/world/HexCellClickListener.java | 5 +- .../gdxgame/idledemo/ui/world/HexCellVM.java | 4 +- .../idledemo/desktop/DesktopLauncher.java | 4 +- .../construction/base/BaseConstruction.java | 6 -- 19 files changed, 112 insertions(+), 65 deletions(-) rename IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/{DemoIdleGame.java => IdleMushroomGame.java} (52%) diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoChildGameConfig.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoChildGameConfig.java index 4416dd5..a758d05 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoChildGameConfig.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoChildGameConfig.java @@ -36,12 +36,12 @@ public DemoChildGameConfig() { .worldPrototypeIds(JavaFeatureForGwt.listOf( DemoConstructionPrototypeId.EPOCH_1_EMPTY_CELL, DemoConstructionPrototypeId.EPOCH_1_TREE, - DemoConstructionPrototypeId.EPOCH_1_MUSHROOM_AUTO_PROVIDER + DemoConstructionPrototypeId.EPOCH_1_MUSHROOM_AUTO_PROVIDER, + DemoConstructionPrototypeId.EPOCH_2_MUSHROOM_AUTO_PROVIDER )) .build() ); - Map> areaShownResourceIds = new HashMap<>(); this.setAreaEntityEffectConfigMap(JavaFeatureForGwt.mapOf( DemoScreenId.SCREEN_MAIN, AreaEntityEffectConfig.builder() diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoIdleGame.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/IdleMushroomGame.java similarity index 52% rename from IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoIdleGame.java rename to IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/IdleMushroomGame.java index 8a63392..ff1e8b6 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/DemoIdleGame.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/IdleMushroomGame.java @@ -13,21 +13,25 @@ import hundun.gdxgame.idleshare.core.framework.model.manager.AudioPlayManager; import hundun.gdxgame.idleshare.core.starter.ui.screen.play.BaseIdleScreen; import hundun.gdxgame.idleshare.gamelib.export.IdleGameplayExport; +import hundun.gdxgame.idleshare.gamelib.framework.model.construction.base.BaseConstruction; import hundun.gdxgame.idleshare.gamelib.framework.util.text.TextFormatTool; -import lombok.Getter; -import lombok.Setter; +import lombok.*; +import java.util.List; +import java.util.Map; -public class DemoIdleGame extends BaseIdleGame { + +public class IdleMushroomGame extends BaseIdleGame { @Getter - protected AbstractIdleScreenContext screenContext; + protected AbstractIdleScreenContext screenContext; @Getter protected IdleMushroomTextureManager idleMushroomTextureManager; + Map epochConfigMap; - public DemoIdleGame(ISaveTool saveTool) { + public IdleMushroomGame(ISaveTool saveTool) { super(960, 640); this.debugMode = true; @@ -46,6 +50,16 @@ public DemoIdleGame(ISaveTool saveTool) { DemoScreenId.SCREEN_WORLD, DemoScreenId.SCREEN_ACHIEVEMENT ); + this.epochConfigMap = JavaFeatureForGwt.mapOf( + 1, EpochConfig.builder() + .constructionTransformConfigs(JavaFeatureForGwt.listOf( + EpochConstructionTransformConfig.builder() + .fromPrototypeId(DemoConstructionPrototypeId.EPOCH_1_MUSHROOM_AUTO_PROVIDER) + .toPrototypeId(DemoConstructionPrototypeId.EPOCH_2_MUSHROOM_AUTO_PROVIDER) + .build() + )) + .build() + ); } @@ -82,5 +96,35 @@ protected void createStage3() { getAudioPlayManager().intoScreen(DemoScreenId.SCREEN_MENU); } - + @Data + @AllArgsConstructor + @Builder + public static class EpochConfig { + List constructionTransformConfigs; + } + + @Data + @AllArgsConstructor + @Builder + public static class EpochConstructionTransformConfig { + String fromPrototypeId; + String toPrototypeId; + } + public void doChangeEpoch(BaseConstruction epochCounter) { + int currentEpochLevel = epochCounter.getSaveData().getLevel(); + EpochConfig epochConfig = epochConfigMap.get(currentEpochLevel); + + idleGameplayExport.getGameplayContext().getConstructionManager().getWorldConstructionInstances().stream() + .forEach(it -> { + EpochConstructionTransformConfig transformConfig = epochConfig.getConstructionTransformConfigs().stream() + .filter(itt -> itt.getFromPrototypeId().equals(it.getPrototypeId())) + .findAny() + .orElse(null); + if (transformConfig != null) { + idleGameplayExport.getGameplayContext().getConstructionManager().addToRemoveQueue(it); + idleGameplayExport.getGameplayContext().getConstructionManager().addToCreateQueue(transformConfig.getToPrototypeId(), it.getPosition()); + } + }); + + } } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoBuiltinConstructionsLoader.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoBuiltinConstructionsLoader.java index b5dfeb6..fef02a8 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoBuiltinConstructionsLoader.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoBuiltinConstructionsLoader.java @@ -21,6 +21,7 @@ public Map getProviderMap(Language langua result.put(DemoConstructionPrototypeId.EPOCH_1_EMPTY_CELL, new DirtPrototype(language)); result.put(DemoConstructionPrototypeId.MAIN_MUSHROOM, new MainMushroomPrototype(language)); result.put(DemoConstructionPrototypeId.EPOCH_1_MUSHROOM_AUTO_PROVIDER, new Epoch1AutoProviderPrototype(language)); + result.put(DemoConstructionPrototypeId.EPOCH_2_MUSHROOM_AUTO_PROVIDER, new Epoch2AutoProviderPrototype(language)); result.put(DemoConstructionPrototypeId.MUSHROOM_AUTO_SELLER, new AutoSellerPrototype(language)); result.put(DemoConstructionPrototypeId.EPOCH_1_TREE, new TreePrototype(language)); result.put(DemoConstructionPrototypeId.EPOCH_COUNTER, new EpochCounterPrototype(language)); diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoGameDictionary.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoGameDictionary.java index 1019748..ea37396 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoGameDictionary.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoGameDictionary.java @@ -26,6 +26,8 @@ public String constructionPrototypeIdToShowName(Language language, String constr return "自动点击器"; case DemoConstructionPrototypeId.MUSHROOM_AUTO_SELLER: return "自动出售器"; + case DemoConstructionPrototypeId.EPOCH_COUNTER: + return "EPOCH_COUNTER"; default: return "口口"; } @@ -39,6 +41,8 @@ public String constructionPrototypeIdToShowName(Language language, String constr return "SimpleAutoClicker"; case DemoConstructionPrototypeId.MUSHROOM_AUTO_SELLER: return "AutoSeller"; + case DemoConstructionPrototypeId.EPOCH_COUNTER: + return "EPOCH_COUNTER"; default: return "[dic lost]"; } @@ -53,24 +57,30 @@ public String constructionPrototypeIdToDetailDescriptionConstPart(Language langu case CN: switch (constructionId) { case DemoConstructionPrototypeId.EPOCH_2_MUSHROOM_AUTO_PROVIDER: + return "EPOCH_2自动获得饼干"; case DemoConstructionPrototypeId.EPOCH_1_MUSHROOM_AUTO_PROVIDER: - return "自动获得饼干"; + return "EPOCH_1自动获得饼干"; case DemoConstructionPrototypeId.MUSHROOM_AUTO_SELLER: return "自动出售饼干"; case DemoConstructionPrototypeId.EPOCH_1_EMPTY_CELL: return "空位置"; + case DemoConstructionPrototypeId.EPOCH_COUNTER: + return "the EPOCH_COUNTER"; default: return "[dic lost]"; } default: switch (constructionId) { case DemoConstructionPrototypeId.EPOCH_2_MUSHROOM_AUTO_PROVIDER: + return "EPOCH_2 Auto gain some cookie"; case DemoConstructionPrototypeId.EPOCH_1_MUSHROOM_AUTO_PROVIDER: - return "Auto gain some cookie"; + return "EPOCH_1 Auto gain some cookie"; case DemoConstructionPrototypeId.MUSHROOM_AUTO_SELLER: return "Auto sell some cookie"; case DemoConstructionPrototypeId.EPOCH_1_EMPTY_CELL: return "Empty"; + case DemoConstructionPrototypeId.EPOCH_COUNTER: + return "the EPOCH_COUNTER"; default: return "[dic lost]"; } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java index fcf1559..83869eb 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/DemoSaveHandler.java @@ -62,8 +62,8 @@ protected RootSaveData genereateStarterRootSaveData() { DemoConstructionPrototypeId.EPOCH_COUNTER + "_" + SINGLETON, ConstructionSaveData.builder() .prototypeId(DemoConstructionPrototypeId.EPOCH_COUNTER) - .level(3) - .workingLevel(1) + .level(0) + .workingLevel(0) .position(uselessPosition) .build() ); @@ -91,6 +91,7 @@ protected RootSaveData genereateStarterRootSaveData() { }); Map ownResources = new HashMap<>(); + ownResources.put(ResourceType.MUSHROOM, 500L); ownResources.put(ResourceType.DNA_POINT, 500L); return RootSaveData.builder() diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/prototype/EpochCounterPrototype.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/prototype/EpochCounterPrototype.java index 347dafe..e72c4d3 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/prototype/EpochCounterPrototype.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/logic/prototype/EpochCounterPrototype.java @@ -18,12 +18,18 @@ public class EpochCounterPrototype extends AbstractConstructionPrototype { public static DescriptionPackage descriptionPackageEN = DescriptionPackage.builder() + .upgradeButtonText("Upgrade") + .upgradeCostDescriptionStart("Upgrade cost") + .upgradeMaxLevelDescription("(max)") .levelDescriptionProvider(DescriptionPackageFactory.WORKING_LEVEL_IMP) .proficiencyDescriptionProvider(DescriptionPackageFactory.EN_PROFICIENCY_IMP) .build(); public static DescriptionPackage descriptionPackageCN = DescriptionPackage.builder() + .upgradeButtonText("升级") + .upgradeCostDescriptionStart("升级费用") + .upgradeMaxLevelDescription("(已达到最大等级)") .levelDescriptionProvider(DescriptionPackageFactory.CN_WORKING_LEVEL_IMP) .proficiencyDescriptionProvider(DescriptionPackageFactory.CN_PROFICIENCY_IMP) .build(); @@ -73,7 +79,7 @@ public BaseConstruction getInstance(GridPosition position) { return 1L; } }); - thiz.getLevelComponent().maxLevel = 3; + thiz.getLevelComponent().maxLevel = 2; return thiz; } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/achievement/AchievementPopupBoard.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/achievement/AchievementPopupBoard.java index e9d55ff..c83e3c1 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/achievement/AchievementPopupBoard.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/achievement/AchievementPopupBoard.java @@ -11,7 +11,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable; import com.badlogic.gdx.utils.Null; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.ui.screen.BaseDemoPlayScreen; import hundun.gdxgame.idleshare.core.starter.ui.component.ResourceAmountPairNode; import hundun.gdxgame.idleshare.gamelib.framework.model.achievement.AbstractAchievement; @@ -50,7 +50,7 @@ private void rebuildUi(@Null AbstractAchievement prototype) { Label rewardLabel = new Label(texts.get(3), parent.getGame().getMainSkin()); this.add(rewardLabel).center().row(); for (ResourcePair entry : prototype.getAwardResourceMap()) { - ResourceAmountPairNode node = new ResourceAmountPairNode<>(parent.getGame(), entry.getType()); + ResourceAmountPairNode node = new ResourceAmountPairNode<>(parent.getGame(), entry.getType()); node.update(entry.getAmount()); this.add(node) .height(parent.getLayoutConst().RESOURCE_AMOUNT_PAIR_NODE_HEIGHT) diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/main/MainScreenConstructionControlBoard.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/main/MainScreenConstructionControlBoard.java index 78710cb..ed98aa0 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/main/MainScreenConstructionControlBoard.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/main/MainScreenConstructionControlBoard.java @@ -139,6 +139,7 @@ public EpochPart( public void changed(ChangeEvent event, Actor actor) { Gdx.app.log(SellerPart.class.getSimpleName(), "upgradeButton changed"); model.getUpgradeComponent().doUpgrade(); + parent.getGame().doChangeEpoch(model); } }); @@ -258,7 +259,6 @@ public void clicked(InputEvent event, float x, float y) { this.workingLevelLabel = new Label("", parent.getGame().getMainSkin()); workingLevelLabel.setAlignment(Align.center); - changeWorkingLevelGroup.add(workingLevelLabel).size(CHILD_WIDTH / 2, CHILD_HEIGHT); this.upWorkingLevelButton = new TextButton("+", parent.getGame().getMainSkin()); upWorkingLevelButton.addListener(new ClickListener() { @@ -276,6 +276,7 @@ public void clicked(InputEvent event, float x, float y) { // ------ this ------ this.add(constructionNameLabel).size(CHILD_WIDTH, NAME_CHILD_HEIGHT).row(); this.add(upgradeButton).size(CHILD_WIDTH, CHILD_HEIGHT).row(); + this.add(workingLevelLabel).size(CHILD_WIDTH, CHILD_HEIGHT).row(); this.add(changeWorkingLevelGroup).size(CHILD_WIDTH, CHILD_HEIGHT).row(); this.add(detailGroup).row(); @@ -313,7 +314,7 @@ private void update() { model.getSaveData().getPosition().getY() )); upgradeButton.setText(model.getDescriptionPackage().getUpgradeButtonText()); - workingLevelLabel.setText(model.getLevelComponent().getWorkingLevelDescription() + "; max: " + model.getMaxLevel()); + workingLevelLabel.setText(model.getLevelComponent().getWorkingLevelDescription() + "; max: " + model.getLevelComponent().maxLevel); // ------ update clickable-state ------ diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/BaseDemoPlayScreen.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/BaseDemoPlayScreen.java index 2e1f8b2..8684ad4 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/BaseDemoPlayScreen.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/BaseDemoPlayScreen.java @@ -2,7 +2,7 @@ import com.badlogic.gdx.Gdx; import hundun.gdxgame.gamelib.starter.listerner.IGameAreaChangeListener; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.logic.RootSaveData; import hundun.gdxgame.idledemo.ui.main.FirstRunningAchievementBoardVM; import hundun.gdxgame.idledemo.ui.world.HexCellVM; @@ -16,18 +16,18 @@ import java.util.ArrayList; import java.util.List; -public abstract class BaseDemoPlayScreen extends BaseIdleScreen +public abstract class BaseDemoPlayScreen extends BaseIdleScreen implements IGameAreaChangeListener, IAchievementBoardCallback, IAchievementStateChangeListener { - protected FirstRunningAchievementBoardVM firstRunningAchievementBoardVM; + protected FirstRunningAchievementBoardVM firstRunningAchievementBoardVM; protected AchievementPopupBoard achievementPopupBoard; - DemoIdleGame demoIdleGame; + IdleMushroomGame idleMushroomGame; protected List showAchievementMaskBoardQueue = new ArrayList<>(); - public BaseDemoPlayScreen(DemoIdleGame game, String screenId) { + public BaseDemoPlayScreen(IdleMushroomGame game, String screenId) { super(game, screenId, DemoScreenContext.customLayoutConst(game)); - this.demoIdleGame = game; + this.idleMushroomGame = game; } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoAchievementScreen.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoAchievementScreen.java index e579af6..189bd03 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoAchievementScreen.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoAchievementScreen.java @@ -1,7 +1,7 @@ package hundun.gdxgame.idledemo.ui.screen; import com.badlogic.gdx.InputProcessor; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.logic.DemoScreenId; import hundun.gdxgame.idledemo.logic.ResourceType; import hundun.gdxgame.idledemo.logic.RootSaveData; @@ -11,13 +11,13 @@ import hundun.gdxgame.idleshare.gamelib.framework.model.achievement.AbstractAchievement; import hundun.gdxgame.idleshare.gamelib.framework.model.manager.AchievementManager.AchievementState; -public class DemoAchievementScreen extends BaseIdleScreen implements IAchievementStateChangeListener { +public class DemoAchievementScreen extends BaseIdleScreen implements IAchievementStateChangeListener { - AllAchievementBoardVM allAchievementBoardVM; + AllAchievementBoardVM allAchievementBoardVM; - public DemoAchievementScreen(DemoIdleGame game) { + public DemoAchievementScreen(IdleMushroomGame game) { super(game, DemoScreenId.SCREEN_ACHIEVEMENT, DemoScreenContext.customLayoutConst(game)); } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoMenuScreen.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoMenuScreen.java index 1045dbb..ef8e6a1 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoMenuScreen.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoMenuScreen.java @@ -3,7 +3,7 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.logic.DemoScreenId; import hundun.gdxgame.idledemo.logic.RootSaveData; import hundun.gdxgame.idleshare.core.starter.ui.screen.menu.BaseIdleMenuScreen; @@ -12,9 +12,9 @@ * @author hundun * Created on 2023/02/16 */ -public class DemoMenuScreen extends BaseIdleMenuScreen { +public class DemoMenuScreen extends BaseIdleMenuScreen { - public DemoMenuScreen(DemoIdleGame game) { + public DemoMenuScreen(IdleMushroomGame game) { super(game, new InputListener(){ @Override diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoScreenContext.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoScreenContext.java index 8195116..cccd505 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoScreenContext.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/DemoScreenContext.java @@ -3,7 +3,7 @@ import com.badlogic.gdx.graphics.g2d.NinePatch; import com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.logic.DemoScreenId; import hundun.gdxgame.idledemo.logic.RootSaveData; import hundun.gdxgame.idleshare.core.framework.model.manager.AbstractIdleScreenContext; @@ -13,7 +13,7 @@ * @author hundun * Created on 2023/02/17 */ -public class DemoScreenContext extends AbstractIdleScreenContext { +public class DemoScreenContext extends AbstractIdleScreenContext { DemoMenuScreen menuScreen; MainPlayScreen mainPlayScreen; @@ -22,7 +22,7 @@ public class DemoScreenContext extends AbstractIdleScreenContext { protected MainScreenPopupInfoBoard secondaryInfoBoard; protected GameEntityManager gameEntityManager; - protected GameImageDrawer gameImageDrawer; - protected MainClickerAnimationVM mainClickerAnimationVM; + protected GameImageDrawer gameImageDrawer; + protected MainClickerAnimationVM mainClickerAnimationVM; protected MainScreenConstructionControlBoard constructionControlBoard; - public MainPlayScreen(DemoIdleGame game) { + public MainPlayScreen(IdleMushroomGame game) { super(game, DemoScreenId.SCREEN_MAIN); } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/WorldPlayScreen.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/WorldPlayScreen.java index c00b628..8922f15 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/WorldPlayScreen.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/screen/WorldPlayScreen.java @@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.utils.viewport.ScreenViewport; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.logic.DemoScreenId; import hundun.gdxgame.idledemo.logic.ResourceType; import hundun.gdxgame.idledemo.ui.world.HexCellVM; @@ -35,7 +35,7 @@ public class WorldPlayScreen extends BaseDemoPlayScreen implements IConstruction @Getter private boolean disableHexAreaInput; - public WorldPlayScreen(DemoIdleGame game) { + public WorldPlayScreen(IdleMushroomGame game) { super(game, DemoScreenId.SCREEN_WORLD); this.deskCamera = new OrthographicCamera(); diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/shared/ConstructionDetailPartVM.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/shared/ConstructionDetailPartVM.java index 0f15e09..9b1d98c 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/shared/ConstructionDetailPartVM.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/shared/ConstructionDetailPartVM.java @@ -6,7 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.utils.Null; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.ui.screen.BaseDemoPlayScreen; import hundun.gdxgame.idleshare.core.starter.ui.component.ResourceAmountPairNode; import hundun.gdxgame.idleshare.gamelib.framework.model.construction.base.BaseConstruction; @@ -81,10 +81,10 @@ public static void resourcePackAsActor(ResourcePack pack, Table target, BaseDemo } } - public static List pairsToActors(List pairs, DemoIdleGame game) { + public static List pairsToActors(List pairs, IdleMushroomGame game) { List pairsToActors = new ArrayList<>(); for (ResourcePair entry : pairs) { - ResourceAmountPairNode node = new ResourceAmountPairNode<>(game, entry.getType()); + ResourceAmountPairNode node = new ResourceAmountPairNode<>(game, entry.getType()); node.update(entry.getAmount()); pairsToActors.add(node); } diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellClickListener.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellClickListener.java index 1c05ad7..7b8cd73 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellClickListener.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellClickListener.java @@ -2,13 +2,12 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; -import hundun.gdxgame.idledemo.DemoIdleGame; -import hundun.gdxgame.idledemo.ui.screen.BaseDemoPlayScreen; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.ui.screen.WorldPlayScreen; public class HexCellClickListener extends ClickListener { - DemoIdleGame game; + IdleMushroomGame game; WorldPlayScreen screen; private final HexCellVM vm; diff --git a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellVM.java b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellVM.java index 08e559f..91bc4ba 100644 --- a/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellVM.java +++ b/IdleMushroom-game/core/src/main/java/hundun/gdxgame/idledemo/ui/world/HexCellVM.java @@ -6,7 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.badlogic.gdx.utils.Null; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; import hundun.gdxgame.idledemo.ui.screen.WorldPlayScreen; import hundun.gdxgame.idleshare.gamelib.framework.model.construction.base.BaseConstruction; import hundun.gdxgame.idleshare.gamelib.framework.model.grid.TileNodeUtils.HexMode; @@ -37,7 +37,7 @@ public enum MaskMode { static float hexBaseSizeX = (float) (HEX_SIZE); static float hexBaseSizeY = (float) (SQR_3_DIV_2_HEX_SIZE); - DemoIdleGame game; + IdleMushroomGame game; HexAreaVM hexAreaVM; @Getter diff --git a/IdleMushroom-game/desktop/src/hundun/gdxgame/idledemo/desktop/DesktopLauncher.java b/IdleMushroom-game/desktop/src/hundun/gdxgame/idledemo/desktop/DesktopLauncher.java index a9fdaf3..252f2f0 100644 --- a/IdleMushroom-game/desktop/src/hundun/gdxgame/idledemo/desktop/DesktopLauncher.java +++ b/IdleMushroom-game/desktop/src/hundun/gdxgame/idledemo/desktop/DesktopLauncher.java @@ -3,14 +3,14 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; -import hundun.gdxgame.idledemo.DemoIdleGame; +import hundun.gdxgame.idledemo.IdleMushroomGame; public class DesktopLauncher { public static void main (String[] arg) { - DemoIdleGame game = new DemoIdleGame(new PreferencesSaveTool("IdleMushroom-destop-save.xml")); + IdleMushroomGame game = new IdleMushroomGame(new PreferencesSaveTool("IdleMushroom-destop-save.xml")); LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.width = (int) (game.getWidth()); diff --git a/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/model/construction/base/BaseConstruction.java b/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/model/construction/base/BaseConstruction.java index 6827b8b..5ecaf6b 100644 --- a/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/model/construction/base/BaseConstruction.java +++ b/idleshare/gamelib/src/hundun/gdxgame/idleshare/gamelib/framework/model/construction/base/BaseConstruction.java @@ -19,12 +19,6 @@ public abstract class BaseConstruction implements IBuffChangeListener, ITileNode { - protected static final int DEFAULT_MAX_LEVEL = 99; - @Getter - @Setter - protected int maxLevel = DEFAULT_MAX_LEVEL; - - protected static final int DEFAULT_MAX_DRAW_NUM = 5; @Getter @Setter