TABLE OF CONTENTS


Crafts/Crafts [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provide code for crafting

SOURCE

package Crafts is

Crafts/Crafts.Craft_Data [ Records ]

[ Top ] [ Crafts ] [ Records ]

FUNCTION

 Data structure for recipes

SOURCE

   type Craft_Data is record
      Material_Types: TinyString_Container.Vector;
      Material_Amounts: Positive_Container.Vector;
      Result_Index: Natural;
      Result_Amount: Natural := 0;
      Workplace: Module_Type;
      Skill: SkillsData_Container.Extended_Index;
      Time: Positive := 1;
      Difficulty: Positive := 1;
      Tool: Tiny_String.Bounded_String;
      Reputation: Reputation_Range;
      Tool_Quality: Positive := 1;
   end record;

PARAMETERS

 Material_Types   - Types of material needed for recipe
 Material_Amounts - Amounts of material needed for recipe
 Result_Index     - Prototype index of crafted item
 Result_Amount    - Amount of products
 Workplace        - Ship module needed for crafting
 Skill            - Skill used in crafting item
 Time             - Minutes needed for finish recipe
 Difficulty       - How difficult is recipe to discover
 Tool             - Type of tool used to craft item
 Reputation       - Minimal reputation in base needed to buy that recipe
 Tool_Quality     - Minimal quality of tool needed to craft that recipe

Crafts/Crafts.Check_Recipe [ Subprograms ]

[ Top ] [ Crafts ] [ Subprograms ]

FUNCTION

 Check if player have all requirements for selected recipe

SOURCE

   function Check_Recipe
     (Recipe_Index: Tiny_String.Bounded_String) return Positive with
      Pre => Tiny_String.Length(Source => Recipe_Index) > 0;

PARAMETERS

 Recipe_Index - Index of the prototype recipe to check or if deconstruct
                existing item, "Study " + item name.

RESULT

 Max amount of items which can be craft

Crafts/Crafts.Set_Recipe [ Subprograms ]

[ Top ] [ Crafts ] [ Subprograms ]

FUNCTION

 Set crafting recipe for selected workshop

SOURCE

   procedure Set_Recipe
     (Workshop, Amount: Positive;
      Recipe_Index: Tiny_String.Bounded_String) with
      Pre => Workshop <= Player_Ship.Modules.Last_Index and
      Tiny_String.Length(Source => Recipe_Index) > 0;

PARAMETERS

 Workshop     - Index of player ship module (workplace) to which
                selected recipe will be set
 Amount       - How many times the recipe will be crafted
 Recipe_Index - Index of the prototype recipe to check or if deconstruct
                existing item, "Study " + item name.

Crafts/Crafts.Set_Recipe_Data [ Subprograms ]

[ Top ] [ Crafts ] [ Subprograms ]

FUNCTION

 Set crafting data for selected recipe

SOURCE

   function Set_Recipe_Data
     (Recipe_Index: Tiny_String.Bounded_String) return Craft_Data;

PARAMETERS

 Recipe_Index - Index of recipe from Recipes_List or full name of recipe
                for deconstructing

RESULT

 Crafting data for selected recipe