Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FactoryComponent

A factory components takes resources from the @see StorageComponent and transforms it into a new resource. It can have multiple recipes.

Hierarchy

Index

Constructors

constructor

  • Parameters

    • __namedParameters: object
      • productionDuration: number
      • productionQueueMax: number
      • recipes: any

    Returns FactoryComponent

Methods

addRecipe

  • addRecipe(recipe: any): void
  • Adds a new supported recipe to the factory

    Parameters

    • recipe: any

    Returns void

deserialize

  • deserialize(data: any): any

getDebugString

  • getDebugString(): string

getEffectiveSpeedRecipesPerSecond

  • getEffectiveSpeedRecipesPerSecond(): number
  • Returns how many recipes this factory can produce per second

    Returns number

getIsCurrentlyProducing

  • getIsCurrentlyProducing(): boolean
  • Returns if the factory currently produces anything

    Returns boolean

internalCheckRecipes

  • internalCheckRecipes(recipes: any): boolean
  • Internal helper method to check all recipes for validity

    Parameters

    • recipes: any

    Returns boolean

producesResource

  • producesResource(resourceId: any): boolean
  • Returns if this factory produces the given resource.

    Parameters

    • resourceId: any

    Returns boolean

    true if the resource is produced

serialize

  • serialize(): object

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string
  • Returns string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string