From f4aa19119bed4a4bdb9e6412bfde7870aef9fdf3 Mon Sep 17 00:00:00 2001 From: Dan Crosby Date: Sun, 4 Jan 2026 13:21:08 -0800 Subject: [PATCH] Remove dead execute method from ProtolessRandomSequentialResultsAction (#5052) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update DEPROTO_PLAN.md: 100% action files now protoless - ResolveBattleAction migrated to Scala types (PR #5048) - All 52 action files are now fully protoless - CommandChoiceHelpers fully migrated to Scala types - Update progress summary and validation checklist 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 * Remove dead execute method from ProtolessRandomSequentialResultsAction The execute(startingState: GameStateProto, applier: ActionResultProtoApplier) method was never called - all actions using this base class now call .results() directly and apply results via RandomStateSequencer or ActionResultApplier. This removes the dead method and its unused dependencies (SeededRandom, ActionResultProtoApplier, VigorXPApplier, ActionResultProtoConverter). Note: The proto GameState export is retained because downstream actions use ProvinceViewFilter which has overloaded methods taking both proto and Scala GameState - overload resolution requires both types to be visible. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --------- Co-authored-by: Claude Opus 4.5 --- .../library/actions/impl/common/BUILD.bazel | 11 ------- ...otolessRandomSequentialResultsAction.scala | 32 +------------------ 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/src/main/scala/net/eagle0/eagle/library/actions/impl/common/BUILD.bazel b/src/main/scala/net/eagle0/eagle/library/actions/impl/common/BUILD.bazel index 5b58ca419c..93ce4c5b4a 100644 --- a/src/main/scala/net/eagle0/eagle/library/actions/impl/common/BUILD.bazel +++ b/src/main/scala/net/eagle0/eagle/library/actions/impl/common/BUILD.bazel @@ -78,26 +78,15 @@ scala_library( "//src/test/scala/net/eagle0/eagle/library/actions:__subpackages__", ], exports = [ - ":action_with_resulting_state", "//src/main/protobuf/net/eagle0/eagle/internal:game_state_scala_proto", - "//src/main/scala/net/eagle0/eagle/library/actions/applier:action_result_proto_applier", "//src/main/scala/net/eagle0/eagle/model/action_result:action_result_trait", ], deps = [ - ":action_with_resulting_state", - ":vigor_xp_applier", - "//src/main/protobuf/net/eagle0/eagle/internal:game_state_scala_proto", "//src/main/scala/net/eagle0/common:functional_random", "//src/main/scala/net/eagle0/eagle:eagle_pkg", - "//src/main/scala/net/eagle0/eagle/library/actions/applier:action_result_proto_applier", "//src/main/scala/net/eagle0/eagle/model/action_result:action_result_trait", - "//src/main/scala/net/eagle0/eagle/model/action_result:changed_battalion_trait", - "//src/main/scala/net/eagle0/eagle/model/action_result:changed_hero_trait", - "//src/main/scala/net/eagle0/eagle/model/action_result:notification_trait", "//src/main/scala/net/eagle0/eagle/model/action_result/concrete:action_result_concrete", - "//src/main/scala/net/eagle0/eagle/model/action_result/generated_text_request", "//src/main/scala/net/eagle0/eagle/model/action_result/types:new_random_seed_result_type", - "//src/main/scala/net/eagle0/eagle/model/proto_converters:action_result_proto_converter", ], ) diff --git a/src/main/scala/net/eagle0/eagle/library/actions/impl/common/ProtolessRandomSequentialResultsAction.scala b/src/main/scala/net/eagle0/eagle/library/actions/impl/common/ProtolessRandomSequentialResultsAction.scala index 69748f342d..c1e3456709 100644 --- a/src/main/scala/net/eagle0/eagle/library/actions/impl/common/ProtolessRandomSequentialResultsAction.scala +++ b/src/main/scala/net/eagle0/eagle/library/actions/impl/common/ProtolessRandomSequentialResultsAction.scala @@ -1,12 +1,9 @@ package net.eagle0.eagle.library.actions.impl.common -import net.eagle0.common.{FunctionalRandom, RandomState, SeededRandom} -import net.eagle0.eagle.internal.game_state.GameState as GameStateProto -import net.eagle0.eagle.library.actions.applier.ActionResultProtoApplier +import net.eagle0.common.{FunctionalRandom, RandomState} import net.eagle0.eagle.model.action_result.concrete.ActionResultC import net.eagle0.eagle.model.action_result.types.NewRandomSeedResultType import net.eagle0.eagle.model.action_result.ActionResultT -import net.eagle0.eagle.model.proto_converters.ActionResultProtoConverter abstract class ProtolessRandomSequentialResultsAction { protected def randomResults( @@ -25,31 +22,4 @@ abstract class ProtolessRandomSequentialResultsAction { newRandomSeed = Some(fr.seed) ) } - - /** - * Execute this action with an explicit starting state and convert results to proto format. - * - * This is the bridge between T-type actions and the proto-based engine interface. - */ - final def execute( - startingState: GameStateProto, - actionResultProtoApplier: ActionResultProtoApplier - ): Vector[ActionWithResultingState] = { - val actionResults = results(SeededRandom(startingState.randomSeed)) - - if actionResults.isEmpty then Vector.empty - else - actionResults - .map(VigorXPApplier.withVigorXp) - .map(ActionResultProtoConverter.toProto) - .foldLeft( - Vector( - ActionWithResultingState( - gameState = startingState, - actionResult = null - ) - ) - )((aws, far) => aws :+ actionResultProtoApplier.applyActionResult(aws.last.gameState, far)) - .drop(1) - } }