Difference between revisions of "Template:BoM"

From ChatWars Wiki
Jump to: navigation, search
(formatting fix)
Line 68: Line 68:
  
 
<!--          -->Basic resources sum:<!--
 
<!--          -->Basic resources sum:<!--
               -->{{#vardefine: n | 0 }}
+
               -->{{#vardefine: n | 0 }}<!--
                {{#while:
+
              -->{{#while:
 
                   | {{#ifexpr: {{#var: n}} < {{#arraysize: neededBasicResources}} | true }}
 
                   | {{#ifexpr: {{#var: n}} < {{#arraysize: neededBasicResources}} | true }}
 
                   | {{#arrayindex: neededQuantities | {{#var: n}} }}x [[{{#arrayindex: neededBasicResources | {{#var: n}} }}]]<br>
 
                   | {{#arrayindex: neededQuantities | {{#var: n}} }}x [[{{#arrayindex: neededBasicResources | {{#var: n}} }}]]<br>

Revision as of 10:10, 9 January 2019

Generates a BoM (Bill of Materials) for an item. Has three modes you can choose with the template parameter outputMode:

  • outputMode = list - Show the most basic resources with all amounts added up.
  • outputMode = tree - Show a tree style list with all the needed resources as child of the intermediate ingredient with different levels of indentation (done)
  • outputMode = all - Show both (Default mode in case parameter is left out)

Uses sub-template Template:ResourceBreakdown