@@ -6993,6 +6993,23 @@ public Accountant getAccountant() {
69936993 return new Accountant (this );
69946994 }
69956995
6996+ /**
6997+ * Calculates and returns a {@code JumpPath} between two planetary systems, using default parameters for jump range
6998+ * and travel safety.
6999+ *
7000+ * <p>This method provides a convenient way to compute the most likely or optimal jump path from the specified
7001+ * starting system to the destination system. Internal behavior and constraints are determined by the method's
7002+ * default parameter settings.</p>
7003+ *
7004+ * @param start the starting {@link PlanetarySystem}
7005+ * @param end the destination {@link PlanetarySystem}
7006+ *
7007+ * @return the calculated {@link JumpPath} between the two systems
7008+ */
7009+ public JumpPath calculateJumpPath (PlanetarySystem start , PlanetarySystem end ) {
7010+ return calculateJumpPath (start , end , true , true );
7011+ }
7012+
69967013 /**
69977014 * Calculates the optimal jump path between two planetary systems using the A* algorithm.
69987015 *
@@ -7008,12 +7025,18 @@ public Accountant getAccountant() {
70087025 *
70097026 * @param start The starting planetary system
70107027 * @param end The destination planetary system
7028+ * @param skipAccessCheck {@code true} to skip checking for Outlaw status in system, {@code false} otherwise.
7029+ * Should be {@code false} when determining contract-related jump paths as
7030+ * system access is guaranteed for contract target systems.
7031+ * @param skipEmptySystemCheck {@code true} to skip checking for empty system status, {@code false} otherwise.
7032+ * Should be {@code false} when determining contract-related jump paths.
70117033 *
70127034 * @return A {@link JumpPath} containing the sequence of systems to traverse, or {@code null} if no valid path
70137035 * exists between the systems. If start and end are the same system, returns a path containing only that
70147036 * system.
70157037 */
7016- public JumpPath calculateJumpPath (PlanetarySystem start , PlanetarySystem end ) {
7038+ public JumpPath calculateJumpPath (PlanetarySystem start , PlanetarySystem end , boolean skipAccessCheck ,
7039+ boolean skipEmptySystemCheck ) {
70177040 // Handle edge cases
70187041 if (null == start ) {
70197042 return new JumpPath ();
@@ -7026,7 +7049,9 @@ public JumpPath calculateJumpPath(PlanetarySystem start, PlanetarySystem end) {
70267049 }
70277050
70287051 // Shortcuts to ensure we're not processing a lot of data when we're unable to reach the target system
7029- if (isAvoidingEmptySystems && end .getPopulation (currentDay ) == 0 ) {
7052+ if (!skipEmptySystemCheck
7053+ && isAvoidingEmptySystems
7054+ && end .getPopulation (currentDay ) == 0 ) {
70307055 new ImmersiveDialogSimple (this , getSeniorAdminPerson (AdministratorSpecialization .TRANSPORT ), null ,
70317056 String .format (resources .getString ("unableToEnterSystem.abandoned.ic" ), getCommanderAddress (false )),
70327057 null , resources .getString ("unableToEnterSystem.abandoned.ooc" ), null , false );
@@ -7036,9 +7061,11 @@ public JumpPath calculateJumpPath(PlanetarySystem start, PlanetarySystem end) {
70367061
70377062 List <AtBContract > activeAtBContracts = getActiveAtBContracts ();
70387063
7039- if (campaignOptions .isUseFactionStandingOutlawed ()) {
7064+ if (!skipAccessCheck
7065+ && campaignOptions .isUseFactionStandingOutlawedSafe ()) {
7066+ FactionHints factionHints = FactionHints .defaultFactionHints ();
70407067 boolean canAccessSystem = FactionStandingUtilities .canEnterTargetSystem (faction , factionStandings ,
7041- getCurrentSystem (), end , currentDay , activeAtBContracts );
7068+ getCurrentSystem (), end , currentDay , activeAtBContracts , factionHints );
70427069 if (!canAccessSystem ) {
70437070 new ImmersiveDialogSimple (this , getSeniorAdminPerson (AdministratorSpecialization .TRANSPORT ), null ,
70447071 String .format (resources .getString ("unableToEnterSystem.outlawed.ic" ), getCommanderAddress (false )),
@@ -7072,6 +7099,8 @@ public JumpPath calculateJumpPath(PlanetarySystem start, PlanetarySystem end) {
70727099 scoreG .put (current , 0.0 );
70737100 closed .add (current );
70747101
7102+ FactionHints factionHints = FactionHints .defaultFactionHints ();
7103+
70757104 // A* search
70767105 final int MAX_JUMPS = 10000 ;
70777106 for (int jumps = 0 ; jumps < MAX_JUMPS ; jumps ++) {
@@ -7095,9 +7124,10 @@ public JumpPath calculateJumpPath(PlanetarySystem start, PlanetarySystem end) {
70957124 }
70967125
70977126 // Skip systems where the campaign is outlawed
7098- if (campaignOptions .isUseFactionStandingOutlawed ()) {
7127+ if (!skipAccessCheck
7128+ && campaignOptions .isUseFactionStandingOutlawed ()) {
70997129 boolean canAccessSystem = FactionStandingUtilities .canEnterTargetSystem (faction , factionStandings ,
7100- getCurrentSystem (), neighborSystem , currentDay , activeAtBContracts );
7130+ getCurrentSystem (), neighborSystem , currentDay , activeAtBContracts , factionHints );
71017131 if (!canAccessSystem ) {
71027132 return ;
71037133 }
0 commit comments