mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 23:35:43 +00:00
Remove dead execute method from ProtolessRandomSequentialResultsAction (#5052)
* 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
+1
-31
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user