Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ItemRecipeRequirementChecker

Hierarchy

  • ItemRecipeRequirementChecker

Index

Constructors

constructor

  • Parameters

    • human: Human
    • Optional recipe: IRecipe
    • Optional trackItems: undefined | false | true
    • Optional cacheItems: undefined | false | true
    • Optional canUseItem: undefined | ((item: Item, isConsumed: boolean, forItemTypeOrGroup: ItemType | ItemTypeGroup) => boolean)

    Returns ItemRecipeRequirementChecker

Properties

itemBaseComponent

itemBaseComponent: Item | undefined

itemComponentsCanBurn

itemComponentsCanBurn: boolean

itemComponentsConsumed

itemComponentsConsumed: Item[]

itemComponentsRequired

itemComponentsRequired: Item[]

numComponentsNeeded

numComponentsNeeded: number

Methods

amountNeededForComponent

  • amountNeededForComponent(componentIndex: number): number
  • Returns the amount of items needed for the component

    Parameters

    • componentIndex: number

    Returns number

getItemsForComponent

  • getItemsForComponent(componentIndex: number): Item[]
  • Returns the items that will be used by the component Only valid when trackItems is true

    Parameters

    • componentIndex: number

    Returns Item[]

isDiscovered

  • isDiscovered(): boolean
  • Returns boolean

process

  • process(allowProtectedItems?: boolean): boolean
  • Looks inside the humans inventory and around adjacent opened doodads

    Parameters

    • Default value allowProtectedItems: boolean = false

    Returns boolean

    true if the recipe's requirements are satisfied

processAdjacent

  • processAdjacent(allowProtectedItems?: boolean): boolean
  • Looks around adjacent containers

    Parameters

    • Default value allowProtectedItems: boolean = false

    Returns boolean

    true if the recipe's requirements are satisfied

processContainer

  • processContainer(container: IContainer, allowProtectedItems?: boolean): boolean
  • Looks inside the container and its subcontainers.

    Parameters

    • container: IContainer

      The container

    • Default value allowProtectedItems: boolean = false

    Returns boolean

    true if the recipe's requirements are satisfied by items in the container.

requirementsMet

  • requirementsMet(): boolean
  • Returns boolean

setAdjacentContainers

  • setAdjacentContainers(adjacentContainers: IContainer[] | undefined): void
  • Parameters

    Returns void

setRecipe

  • Parameters

    Returns void

Generated using TypeDoc