Cosmos Journeyer API Documentation - v1.10.1
    Preparing search index...

    Incremental A* pathfinder to find the shortest path between two star systems

    Index

    Constructors

    Methods

    • Get the number of iterations executed by the pathfinder

      Returns number

      The number of iterations executed by the pathfinder. Will return 0 if the pathfinder has not been initialized.

    • Get the path between the start and target systems (ordered from start to target)

      Returns Result<
          {
              localX: number;
              localY: number;
              localZ: number;
              starSectorX: number;
              starSectorY: number;
              starSectorZ: number;
          }[],
          Error,
      >

      An array of StarSystemCoordinates objects representing the path between the start and target systems

    • Check if the pathfinder has found a path between the start and target systems

      Returns boolean

      True if a path has been found, false otherwise. Will return false if the pathfinder has not been initialized.

    • Initialize the pathfinder

      Parameters

      • startSystemCoordinates: {
            localX: number;
            localY: number;
            localZ: number;
            starSectorX: number;
            starSectorY: number;
            starSectorZ: number;
        }

        The seed of the starting system

        • localX: number

          Floating point X coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • localY: number

          Floating point Y coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • localZ: number

          Floating point Z coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • starSectorX: number

          Integer coordinates of the star sector along the universe X axis

        • starSectorY: number

          Integer coordinates of the star sector along the universe Y axis

        • starSectorZ: number

          Integer coordinates of the star sector along the universe Z axis

      • targetSystemCoordinates: {
            localX: number;
            localY: number;
            localZ: number;
            starSectorX: number;
            starSectorY: number;
            starSectorZ: number;
        }

        The seed of the target system

        • localX: number

          Floating point X coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • localY: number

          Floating point Y coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • localZ: number

          Floating point Z coordinate of the star system inside the star sector. Must be between -0.5 and 0.5.

        • starSectorX: number

          Integer coordinates of the star sector along the universe X axis

        • starSectorY: number

          Integer coordinates of the star sector along the universe Y axis

        • starSectorZ: number

          Integer coordinates of the star sector along the universe Z axis

      • jumpRange: number

        The jump range of the ship in light years

      Returns void