mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 09:55:41 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84558ef99a |
+35
-15
@@ -126,26 +126,46 @@ src/main/scala/net/eagle0/eagle/library/RoundPhaseAdvancer.scala
|
||||
```
|
||||
Now accepts Scala `GameState` and `ActionResultApplier`. Only converts to proto lazily for `AvailableCommandsFactory` calls.
|
||||
|
||||
**Tier 3 - Sequencers:**
|
||||
**Tier 3 - Sequencers:** ✅ **Protoless Sequencer Created (PR #4679)**
|
||||
```
|
||||
src/main/scala/net/eagle0/eagle/library/actions/impl/common/RandomStateTSequencer.scala
|
||||
src/main/scala/net/eagle0/eagle/library/actions/impl/common/RandomStateProtoSequencer.scala
|
||||
src/main/scala/net/eagle0/eagle/library/actions/random_state_sequencer/RandomStateSequencer.scala (NEW - protoless)
|
||||
src/main/scala/net/eagle0/eagle/library/actions/impl/common/LegacyRandomStateTSequencer.scala (LEGACY - proto-based)
|
||||
```
|
||||
Modify `RandomStateTSequencer` to thread Scala `GameState` throughout (currently converts to proto internally). Then evaluate whether `RandomStateProtoSequencer` is still needed at all.
|
||||
|
||||
**Current State**: `RandomStateTSequencer` accepts Scala `GameState` via its `apply()` method but internally converts to proto. All callback methods (`withRandomActionResult`, `withActionResults`, etc.) pass `GameStateProto` to callers, forcing actions that use the sequencer to work with proto types internally.
|
||||
A fully protoless `RandomStateSequencer` has been created. The old sequencer was renamed to `LegacyRandomStateTSequencer`.
|
||||
|
||||
**Target State**: Create a fully protoless sequencer where:
|
||||
1. `lastState` returns Scala `GameState` (not `lastStateProto`)
|
||||
2. All callback methods pass Scala `GameState` to callers
|
||||
3. Actions using the sequencer can be fully protoless
|
||||
**RandomStateSequencer Features:**
|
||||
- `lastState` returns Scala `GameState` (not proto)
|
||||
- All callback methods pass Scala `GameState` to callers
|
||||
- Uses `ActionResultApplier` (Scala-based) instead of `ActionResultTApplier` (proto-based)
|
||||
|
||||
**Migration Path**:
|
||||
1. Add `lastState: GameState` method alongside `lastStateProto` (non-breaking)
|
||||
2. Add parallel callback methods that pass Scala GameState (e.g., `withScalaActionResult`)
|
||||
3. Migrate actions one by one to use the new Scala-based callbacks
|
||||
4. Once all actions migrated, deprecate/remove proto-based callbacks
|
||||
5. Remove `lastStateProto` once no longer used
|
||||
**Migration Progress (Phase 6a):**
|
||||
|
||||
| Action | Status | Blocking Issue |
|
||||
|--------|--------|----------------|
|
||||
| `TruceTurnBackPhaseAction` | ✅ PR #4680 Merged | — |
|
||||
| `EndVassalCommandsPhaseAction` | ❌ Blocked | `CheckForFulfilledQuestsAction` requires proto `BattalionType` |
|
||||
| `NewRoundAction` | ❌ Blocked | Complex; uses `LegacyRandomStateTSequencer.fromProto`, many proto utilities |
|
||||
| `PerformReconResolutionAction` | ❌ Blocked | Uses proto-based callbacks extensively |
|
||||
| `PerformUnaffiliatedHeroesAction` | ❌ Blocked | Uses proto-based callbacks extensively |
|
||||
| `PerformVassalCommandsPhaseAction` | ❌ Blocked | Uses `withOptionalRandomTCommand` with proto callbacks |
|
||||
| `PerformVassalDefenseDecisionsAction` | ❌ Blocked | Uses `withOptionalRandomTCommand` with proto callbacks |
|
||||
| `EndBattleAftermathPhaseAction` | ❌ Blocked | Uses proto `DeferredChange`, `ProvinceViewFilter` |
|
||||
| `EndDiplomacyResolutionPhaseAction` | ❌ Blocked | Uses proto-based callbacks extensively |
|
||||
| `EndHandleRiotsPhaseAction` | ❌ Blocked | Uses `lastStateProto`, `LegacyProvinceUtils`, `withRandomContinuance` |
|
||||
| `EndPlayerCommandsPhaseAction` | ❌ Blocked | Uses proto-based callbacks extensively |
|
||||
| `ProtolessSequentialResultsActionWrapper` | N/A | Bridge class - wraps Scala results for proto consumers |
|
||||
|
||||
**Common Blocking Patterns:**
|
||||
1. **Proto utilities**: Many actions use `LegacyProvinceUtils`, `ProvinceViewFilter`, etc. which expect `GameStateProto`
|
||||
2. **TCommand pattern**: `withOptionalRandomTCommand` passes `GameStateProto` to callbacks
|
||||
3. **Downstream actions**: Some actions call other actions that require proto types (e.g., `CheckForFulfilledQuestsAction` needs proto `BattalionType`)
|
||||
4. **Proto-specific types**: `DeferredChange`, view filters, and some domain types are still proto-only
|
||||
|
||||
**Next Steps:**
|
||||
1. Convert blocking utility classes to accept Scala types
|
||||
2. Add Scala versions of proto-only types where needed
|
||||
3. Migrate actions incrementally as dependencies are converted
|
||||
|
||||
**Tier 4 - History APIs:**
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user