A Wiki in the Desert
Log in

Difference between revisions of "Template:RequireTable"

From A Wiki in the Desert
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#vardefine:isComplex|{{#switch: {{FULLPAGENAME}} | Treated Boards = true | false }}}}
+
{{#vardefine:isComplex|{{#switch: {{FULLPAGENAME}} | Treated Boards = true | Treated Metal = true | Gearbox = true | Paint = true | Raeli Tiles = true | Cut Gems = true | false }}}}
{{#var: isComplex}}
+
{{#ifeq: {{trim|{{{1}}}}} | All |{{#arraydefine:buildings|{{#ask:
{{#ifeq: {{trim|{{{1}}}}} | Building |
+
    [[Has subobject::<q>[[requires::{{FULLPAGENAME}}]]</q>]] | link=none |limit = 1000
{{#arraydefine:buildings|{{#ask:
+
}}}}}}{{#ifeq: {{trim|{{{1}}}}} | Building |{{#arraydefine:buildings|{{#ask:
 
     [[Category:Buildings]]
 
     [[Category:Buildings]]
     [[Has subobject::<q>[[requires::{{FULLPAGENAME}}]]</q>]] | link=none
+
     [[Has subobject::<q>[[requires::{{FULLPAGENAME}}]]</q>]] | link=none |limit = 1000
}}}}
+
}}}}}}{{#ifeq: {{trim|{{{1}}}}} | Research |{{#arraydefine:buildings|{{#ask:
}}
+
     [[Category:Technologies]]
{{#ifeq: {{trim|{{{1}}}}} | Research |
+
     [[Has subobject::<q>[[requires::{{FULLPAGENAME}}]]</q>]] | link=none |limit = 1000
{{#arraydefine:buildings|{{#ask:
+
}}}}}}{| class="smwtable-clean sortable"  
     [[Category:Research]]
+
! Building  
     [[Has subobject::<q>[[requires::{{FULLPAGENAME}}]]</q>]] | link=none
+
! Count  
}}}}
+
{{#ifeq: {{#var: isComplex}} | true | ! Properties}}
}}
+
! Verified
<table class="smwtable-clean sortable">
+
|-
<tr><th>Building</th><th>Count</th>{{#ifeq: {{#var: isComplex}} | true | <th>Properties</th>}}
 
 
{{#loop: i
 
{{#loop: i
 
   | 0
 
   | 0
Line 29: Line 28:
 
     | {{ #arraysize:requirements }}
 
     | {{ #arraysize:requirements }}
 
     |
 
     |
     <tr>
+
     {{!}}-
      <td>[[{{ #arrayindex: buildings | {{ #var:i }} }}]]</td>
+
    {{!}}[[{{ #arrayindex: buildings | {{ #var:i }} }}]]
      <td>{{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?count#= |mainlabel=- }}</td>
+
    {{!}} style="text-align: center" {{!}} {{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?count#= |mainlabel=- }}
      <td>{{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?requires_property#= |mainlabel=- }}</td>
+
    {{#ifeq: {{#var: isComplex}} | true | {{!}} style="text-align: center" {{!}} {{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?requires_property#= |mainlabel=- }}}}
    </tr>
+
    {{!}} style="text-align: center" {{!}} {{#ifeq: {{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?verified#= |mainlabel=- }}|True|<v/>|<uv/>}}
 +
    {{!}}-
 
   }}
 
   }}
 
}}
 
}}
</table>
+
|}

Latest revision as of 15:22, 7 May 2021

Building Count Verified