Function getBodyparts

  • Count the number of bodyparts of a given type

    Parameters

    • body: readonly ({} | {} | {} | {} | {} | {} | {} | {})[]

      Array of bodyparts Creep.body

    • type: BodyPartConstant

      Expected type

    • active: boolean = false

      Count only active bodyparts

    Returns number

    Number of bodyparts

Generated using TypeDoc