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

    Describes any node in the mission tree.

    interface MissionNodeBase<T extends MissionNodeType> {
        describe(
            originSystemCoordinates: {
                localX: number;
                localY: number;
                localZ: number;
                starSectorX: number;
                starSectorY: number;
                starSectorZ: number;
            },
            starSystemDatabase: StarSystemDatabase,
        ): string;
        describeNextTask(
            context: MissionContext,
            keyboardLayout: Map<string, string>,
            starSystemDatabase: StarSystemDatabase,
        ): string;
        equals(other: MissionNode): boolean;
        getTargetSystems(): {
            localX: number;
            localY: number;
            localZ: number;
            starSectorX: number;
            starSectorY: number;
            starSectorZ: number;
        }[];
        isCompleted(): boolean;
        serialize(): | Extract<
            {
                objectId: {
                    idInSystem: string;
                    systemCoordinates: {
                        localX: number;
                        localY: number;
                        localZ: number;
                        starSectorX: number;
                        starSectorY: number;
                        starSectorZ: number;
                    };
                };
                state: AsteroidFieldMissionState;
                type: ASTEROID_FIELD;
            },
            { type: T },
        >
        | Extract<
            {
                objectId: {
                    idInSystem: string;
                    systemCoordinates: {
                        localX: number;
                        localY: number;
                        localZ: number;
                        starSectorX: number;
                        starSectorY: number;
                        starSectorZ: number;
                    };
                };
                state: FlyByState;
                type: FLY_BY;
            },
            { type: T },
        >
        | Extract<
            {
                objectId: {
                    idInSystem: string;
                    systemCoordinates: {
                        localX: number;
                        localY: number;
                        localZ: number;
                        starSectorX: number;
                        starSectorY: number;
                        starSectorZ: number;
                    };
                };
                state: LandMissionState;
                type: TERMINATOR_LANDING;
            },
            { type: T },
        >
        | Extract<
            { children: MissionNodeSerializedShape[]; type: AND },
            { type: T },
        >
        | Extract<
            { children: MissionNodeSerializedShape[]; type: OR },
            { type: T },
        >
        | Extract<
            { children: MissionNodeSerializedShape[]; type: XOR },
            { type: T },
        >
        | Extract<
            {
                activeChildIndex: number;
                children: MissionNodeSerializedShape[];
                type: SEQUENCE;
            },
            { type: T },
        >;
        updateState(context: MissionContext): void;
    }

    Type Parameters

    Implemented by

    Index

    Methods

    • Describes the node recursively.

      Parameters

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

        The seed of the system where the mission has been given.

        • 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

      • starSystemDatabase: StarSystemDatabase

      Returns string

    • Returns the target systems of the subtree.

      Returns {
          localX: number;
          localY: number;
          localZ: number;
          starSectorX: number;
          starSectorY: number;
          starSectorZ: number;
      }[]

      • 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

    • Serializes the node recursively.

      Returns
          | Extract<
              {
                  objectId: {
                      idInSystem: string;
                      systemCoordinates: {
                          localX: number;
                          localY: number;
                          localZ: number;
                          starSectorX: number;
                          starSectorY: number;
                          starSectorZ: number;
                      };
                  };
                  state: AsteroidFieldMissionState;
                  type: ASTEROID_FIELD;
              },
              { type: T },
          >
          | Extract<
              {
                  objectId: {
                      idInSystem: string;
                      systemCoordinates: {
                          localX: number;
                          localY: number;
                          localZ: number;
                          starSectorX: number;
                          starSectorY: number;
                          starSectorZ: number;
                      };
                  };
                  state: FlyByState;
                  type: FLY_BY;
              },
              { type: T },
          >
          | Extract<
              {
                  objectId: {
                      idInSystem: string;
                      systemCoordinates: {
                          localX: number;
                          localY: number;
                          localZ: number;
                          starSectorX: number;
                          starSectorY: number;
                          starSectorZ: number;
                      };
                  };
                  state: LandMissionState;
                  type: TERMINATOR_LANDING;
              },
              { type: T },
          >
          | Extract<
              { children: MissionNodeSerializedShape[]; type: AND },
              { type: T },
          >
          | Extract<
              { children: MissionNodeSerializedShape[]; type: OR },
              { type: T },
          >
          | Extract<
              { children: MissionNodeSerializedShape[]; type: XOR },
              { type: T },
          >
          | Extract<
              {
                  activeChildIndex: number;
                  children: MissionNodeSerializedShape[];
                  type: SEQUENCE;
              },
              { type: T },
          >