RecipeDictionary

RecipeDictionary

class

Named group of recipes shared by machines of one family

  • load-only Usable only while mods load. The game seals these members once loading finishes, so a call or a write from a running world raises an error.

Fields

NameTypeDescription
start_tier load-only integer Machine-unlock tier shared by every recipe in the dictionary

Functions

RecipeDictionary:add(recipe) load-only

Put a recipe into this dictionary

recipe Recipe

returns boolean False when the recipe is null or its name is already taken

RecipeDictionary:used_in(item) load-only

Name a machine item that crafts from this dictionary; the first one is the face the recipe index files its recipes under

item StaticItem

returns boolean False when the item is null

RecipeDictionary:recipes()

Every recipe of this dictionary, in the order the crafting UI lists them

returns Recipe[] Recipes of this dictionary

RecipeDictionary:recipe(name)

Look a recipe of this dictionary up by name; recipe names repeat across dictionaries, so this is the only way to address one

name string The name of the recipe

returns Recipe Nil when this dictionary has no such recipe

RecipeDictionary:remove(recipe) load-only

Take a recipe out of this dictionary and out of every research unlocking it. Crafters that had it selected in a save fall back to no recipe

recipe Recipe

returns boolean False when the recipe is null or belongs to another dictionary

Standard members (5)

Every class of this kind carries these.

RecipeDictionary.cast(object) Trying to cast Object into RecipeDictionary
RecipeDictionary.get_class() Return RecipeDictionary class object
RecipeDictionary.find(name) Looks RecipeDictionary up in db, nil when there is none
RecipeDictionary.get(name) Takes RecipeDictionary from db, reports a miss to the log
RecipeDictionary.reg(name) load-only Register a new RecipeDictionary static object
Inherited from Prototype (2)
Inherited from Object (1)

Used by