screeps-clockwork
    Preparing search index...

    Class ClockworkPath

    A path from a start position to an end position. Typically returned by a function like pathToFlowFieldOrigin rather than created directly.

    Index

    Constructors

    Accessors

    Methods

    • Iterate over the path.

      Returns { next: () => { done: boolean; value: RoomPosition } }

      for (const pos of path) {
      console.log(pos);
      }
    • Given a current position, find the index of the next position in the path.

      Parameters

      • pos: RoomPosition

      Returns undefined | number

    • Get the position at a given index.

      Parameters

      • index: number

      Returns RoomPosition

    • Iterate over the path in reverse order.

      Returns Generator<
          never,
          { next: () => { done: boolean; value: RoomPosition } },
          unknown,
      >

      for (const pos of path.reversed()) {
      console.log(pos);
      }
    • Convert the path to an array of positions.

      Returns RoomPosition[]

    • Convert the path to an array of positions in reverse order.

      Returns RoomPosition[]