Skip to content

Conversation

@Bertie690
Copy link
Contributor

@Bertie690 Bertie690 commented Nov 15, 2025

What are the changes the user will see?

N/A

Why am I making these changes?

It kinda doesn't make sense that setOrder only applies to move uses, and it DEFINITELY doesn't make sense for it to be coupled so tightly to the MovePhasePriorityQueue infrastructure.

What are the changes from a developer perspective?

  1. Moved the setOrder array into a basic TurnCommandManager class whose current only job is managing said array.
  2. Moved checks for it from exclusively being in MovePhasePriorityQueue to being checked during sortInSpeedOrder (to apply to all non-phase speed order interactions, not just moves)
  3. Made game.setTurnOrder not async anymore since it effectively just sets a single variable.
  4. Fixed a couple tests that relied on the aforementioned function advancing the phase interceptor

Note

I will bulk-remove asyncs from existing callsites in a subsequent PR.

Note

I kept in the (admittedly somwwhat questionable) behavior of resetting the setOrder array on queue manager clearance.
If we really want this to be usable for MEs (which was the only reason I agreed to keep it inside src in the first place), this will have to be changed in a follow-up PR.

Screenshots/Videos

N/A

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs
  • Have I provided a clear explanation of the changes?
  • Have I tested the changes manually?
  • Are all unit tests still passing? (pnpm test:silent)

@Bertie690 Bertie690 requested a review from a team as a code owner November 15, 2025 03:30
@Bertie690 Bertie690 changed the title [Refactor/Test] Cleaned up and generalized setTurnOrder to apply to non-move effects [Refactor/Test] Decoupled setOrder from MovePhases; made setTurnOrder not async Nov 15, 2025
@Bertie690 Bertie690 changed the title [Refactor/Test] Decoupled setOrder from MovePhases; made setTurnOrder not async [Refactor/Test] Decouple setOrder from MovePhases; make setTurnOrder not async Nov 15, 2025
@Bertie690 Bertie690 changed the title [Refactor/Test] Decouple setOrder from MovePhases; make setTurnOrder not async [Refactor/Test] Decouple setOrder from MovePhases; make setTurnOrder no longer async Nov 15, 2025
@Madmadness65 Madmadness65 added Tests Automated tests related Refactor Rewriting existing code related labels Nov 15, 2025
emdeann
emdeann previously approved these changes Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Rewriting existing code related Tests Automated tests related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants