Skip to content

Core: Move GER EntranceLookup onto ERPlacementState. Improve usefulness of on_connect #4904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BadMagic100
Copy link
Collaborator

@BadMagic100 BadMagic100 commented Apr 19, 2025

What is this fixing or adding?

This makes a variety of general enhancements to the data available to the on_connect callback in GER. The motivator for this is to allow making additional entrance connections in this callback, which was always intended but implemented incredibly poorly

  1. The EntranceLookup used by GER is now owned by and visible on the placement state. This allows it to be accessed from the on_connect callback, and allows callers to use er_state.connect without having to manage the EntranceLookup.
  2. Added a find_target method on EntranceLookup, allowing callers to search for unplaced entrances to be able to make their own placements (functional equivalent of get_entrance for the uncached ER targets)
  3. Updated the signature of on_connect to take in the paired targets as well so they can be used to make decisions about the side effects to be performed. This is technically breaking but tmk no merged worlds use GER yet so this should still be safe, but I believe it necessary even if it weren't safe and I don't see a way to avoid the break
  4. Allow on_connect to signal that it has made entrance placements by returning True, and allow an additional state sweep afterwards if needed

How was this tested?

Added new unit tests for the new method and verified existing behavior has not regressed.

@github-actions github-actions bot added the affects: core Issues/PRs that touch core and may need additional validation. label Apr 19, 2025
@BadMagic100 BadMagic100 added is: enhancement Issues requesting new features or pull requests implementing new features. and removed affects: core Issues/PRs that touch core and may need additional validation. labels Apr 19, 2025
@github-actions github-actions bot added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Apr 19, 2025
@BadMagic100 BadMagic100 added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. and removed waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant