screeps-clockwork
    Preparing search index...

    Class FlowField

    A flow field is a 50x50 grid (representing a room), representing viable directions to travel to reach a particular target (or targets). A given tile may have multiple equally valid directions, so we represent this as a bitfield (where each bit in an 8-bit unsigned integer represents a direction that is either viable or not).

    Index

    Methods

    • Add a direction to the list of valid directions for a given coordinate.

      Parameters

      • x: number
      • y: number
      • direction: Direction

      Returns void

    • Returns void

    • Get the internal value for a given coordinate.

      Parameters

      • x: number
      • y: number

      Returns number

    • Get the list of valid directions for a given coordinate.

      Parameters

      • x: number
      • y: number

      Returns any[]

    • Set the internal value for a given coordinate.

      Parameters

      • x: number
      • y: number
      • value: number

      Returns void

    • Set the list of valid directions for a given coordinate.

      Parameters

      • x: number
      • y: number
      • directions: any[]

      Returns void