pub struct LuaRecipe;Expand description
A crafting recipe. Recipes belong to forces (see LuaForce) because some recipes are unlocked by research, and researches are per-force.
Implementations§
Source§impl LuaRecipe
impl LuaRecipe
Sourcepub fn categories(&self) -> Vec<&str>
pub fn categories(&self) -> Vec<&str>
Categories of the recipe.
Sourcepub fn energy(&self) -> f64
pub fn energy(&self) -> f64
Energy required to execute this recipe. This directly affects the crafting time: Recipe’s energy is exactly its crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one.
Is the recipe hidden? Hidden recipes don’t show up in the crafting menu.
Is the recipe hidden from flow statistics?
Sourcepub fn ingredients(&self) -> Vec<Ingredient>
pub fn ingredients(&self) -> Vec<Ingredient>
The ingredients to this recipe.
pub fn localised_description(&self) -> &str
Sourcepub fn localised_name(&self) -> &str
pub fn localised_name(&self) -> &str
Localised name of the recipe.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Name of the recipe. This can be different than the name of the result items as there could be more recipes to make the same item.
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn order(&self) -> &str
pub fn order(&self) -> &str
The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
Sourcepub fn productivity_bonus(&self) -> f32
pub fn productivity_bonus(&self) -> f32
The productivity bonus for this recipe.
Sourcepub fn prototype(&self) -> LuaRecipePrototype
pub fn prototype(&self) -> LuaRecipePrototype
The prototype for this recipe.
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
Sourcepub fn has_category(&self, category: LuaAny) -> bool
pub fn has_category(&self, category: LuaAny) -> bool
Checks if recipe has given category