Skip to content

Centralize transport type configuration#401

Open
FIrgolitsch wants to merge 2 commits intoSkretzo:masterfrom
FIrgolitsch:pr/config-centralization
Open

Centralize transport type configuration#401
FIrgolitsch wants to merge 2 commits intoSkretzo:masterfrom
FIrgolitsch:pr/config-centralization

Conversation

@FIrgolitsch
Copy link
Copy Markdown
Collaborator

Centralize per-transport-type configuration (enabled state, cost) into a single TransportTypeConfig class, replacing scattered boolean/int fields in PathfinderConfig.

Depends on: #329 (Transport Parsing Refactor)

Changes

  • New TransportTypeConfig.java: Centralized per-type enabled/cost configuration with TransportTypeConfigTest
  • TransportType.java: Added enabledGetter() and costGetter() methods to link each type to its config accessor
  • ShortestPathPlugin.java: Override methods for transport type enabled/cost settings
  • PathfinderConfig.java: Replaced individual boolean/int fields (useAgilityShortcuts, costFairyRings, etc.) with a single TransportTypeConfig instance

6 files changed (on top of #329), +907/−359

- Add parser package: TsvParser, TransportRecord, FieldParser,
  WorldPointParser, SkillRequirementParser, ItemRequirementParser,
  QuestParser, VarCheckType, VarRequirement, VarRequirementParser
- Add requirement package: ItemRequirement, TransportItems
- Remove old model classes: TransportVarCheck, TransportVarbit,
  TransportVarPlayer, TransportItems (old)
- Update Transport.java with builder pattern and TransportRecord
  constructor
- Update TransportType with resourcePath, radiusThreshold,
  isTeleport() instance method, refine()
- Update TransportLoader to use TsvParser
- Update PathfinderConfig to use VarRequirement and ItemRequirement
- Update overlays for isTeleport() instance method
- Update all tests for new types
- Add TransportTypeConfig to manage enabled/cost state per TransportType
- Add enabledGetter and costGetter functional fields to TransportType
- Add override(TransportType, ...) convenience methods to ShortestPathPlugin
- Replace individual boolean fields and if-else chain in
  PathfinderConfig.useTransport() with TransportTypeConfig lookups
- Extract checkPohVariant, checkTeleportationItemRules,
  checkJewelleryBoxTier, remapPohTransports helper methods
- Remove artificialTransportCosts EnumMap (costs from config via costGetter)
- Remove testTeleportationBoxes (now gated by useTeleportationItems)
- Add TransportTypeConfigTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant