Difference between revisions of "Template:BoM"

From ChatWars Wiki
Jump to: navigation, search
Line 4: Line 4:
  
 
<div class="mw-collapsible-content" style="width: intrinsic; width: -moz-max-content; width: -webkit-max-content; text-align: left; white-space: nowrap;">
 
<div class="mw-collapsible-content" style="width: intrinsic; width: -moz-max-content; width: -webkit-max-content; text-align: left; white-space: nowrap;">
 
+
{{#vardefineecho: listOutputBuffer
 +
  | {{#ask:
 +
    [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::+]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]]
 +
    |mainlabel=-
 +
    |headers=hide
 +
    |format=template
 +
    |template=ResourceBreakdown
 +
    |userparam=0;1<!-- first number is depth, second is multiplier-->
 +
    |sort=Qty,Crafting ingredient
 +
    |order=desc,asc
 +
    |?Crafting ingredient
 +
    |?Qty
 +
    }}
 +
}}
 +
<!-- tree style list of resources + intermediate steps-->
 
{{#switch: {{#var: outputMode}}
 
{{#switch: {{#var: outputMode}}
 
   | tree | all = {{#ask:
 
   | tree | all = {{#ask:
Line 17: Line 31:
 
                   |?Crafting ingredient
 
                   |?Crafting ingredient
 
                   |?Qty
 
                   |?Qty
                  |?ManaCrafting
 
 
                 }}
 
                 }}
 
}}<!--
 
}}<!--
 +
List of basic resources + mana usage
 
-->{{#switch: {{#var: outputMode}}
 
-->{{#switch: {{#var: outputMode}}
 
   | list | all = {{#vardefine: resourceList
 
   | list | all = {{#vardefine: resourceList
Line 33: Line 47:
 
                       |?Crafting ingredient
 
                       |?Crafting ingredient
 
                       |?Qty
 
                       |?Qty
                      |?ManaCrafting
 
 
                     }}
 
                     }}
 
                 }}
 
                 }}

Revision as of 15:10, 31 December 2018

Generates a BoM (Bill of Materials) for an item. Has three modes:

  • Show the most basic resources with all amounts added up. (WIP, not possible without semantic wiki array extension)
  • Show a tree style list with all the needed resources as child of the intermediate ingredient with different levels of indentation (done)
  • Show both

Uses sub-template Template:ResourceBreakdown