Example
<noinclude>{{UprisingComponents/WarningBox|name=material desh scraps|title=Desh Scraps|template=UprisingComponents|templateTitle=UprisingComponents|extra=<br><span style="margin-left:45px;color:red;"><big><u>'''Do Not edit without discussion first.'''</u></big></span>}}</noinclude><!--
--><onlyinclude>{{#switch:{{lc:{{{get|}}}}}<!-- Compare against the lowercase "get" input
General Component Attributes
----------------------------
-->|basename|name=Desh Scraps<!--
-->|type=Material<!--
-->|subtype=Neutral<!--
-->|element=Neutral<!--
-->|minlevel=1<!--
-->|maxlevel=7<!--
-->|description=This material protects against normal damage.<!--
If the get value doesn't match a general attribute, check if the request is for a level specific attribute.
- Check if "level" is explicitly given
or level prefix
or full name of item at that level
-->|#default={{#switch:{{lc:{{#if:{{{level|}}}|{{{level}}}|{{#if:{{{prefix|}}}|{{{prefix}}}|{{#if:{{{levelName|{{{normalizedName|{{{name|}}}}}}}}}|{{{levelName|{{{normalizedName|{{{name}}}}}}}}}|}}}}}}}}<!--
Check against possible combinations of names, prefixes, and spaces. Then check if it is an explicit level number match.
-->|perforated|perforateddesh scraps|perforated desh scraps|perforateddeshscraps|perforated deshscraps|1={{#switch:{{lc:{{{get|}}}}}<!--
Component Level Specific Attributes
-----------------------------------
-->|prefix|levelname=Perforated<!--
-->|level|baselevel|levelnum=1<!--
-->|fullname|levelfullname=Perforated Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_01.png<!--
-->|credits|value|price=52<!--
-->|usecost|useprice=100<!--
-->|upgradecost|upgradeprice=150<!--
Separate multiple ways to get the material by simply putting each in a div element
-->|howget|howtoget=<div>Low level and repeatable missions.</div><div>Minor reward level missions.</div><div>The <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Supply_Crane|Supply Crane]]</span> in exchange for a <span class="class-style color-gray color-link-gray">[[Requisition_scrip|Requisition Scrip]]</span>.</div><!--
-->|xp=400<!--
-->}}<!--
-->|pressed|presseddesh scraps|pressed desh scraps|presseddeshscraps|pressed deshscraps|2={{#switch:{{lc:{{{get|}}}}}<!--
-->|prefix|levelname=Pressed<!--
-->|level|baselevel|levelnum=2<!--
-->|fullname|levelfullname=Pressed Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_02.png<!--
-->|credits|value|price=157<!--
-->|usecost|useprice=300<!--
-->|upgradecost|upgradeprice=450<!--
-->|howget|howtoget=<div>Combine 4 Perforated Desh Scraps.</div><div>Low level and repeatable missions.</div><div>Minor reward level missions.</div><div>The <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Supply_Crane|Supply Crane]]</span> in exchange for a <span class="class-style color-gray color-link-gray">[[Requisition_scrip|Requisition Scrip]]</span>.</div><!--
-->|xp=1640<!--
-->}}<!--
-->|forged|forgeddesh scraps|forged desh scraps|forgeddeshscraps|forged deshscraps|3={{#switch:{{lc:{{{get|}}}}}<!--
-->|prefix|levelname=Forged<!--
-->|level|baselevel|levelnum=3<!--
-->|fullname|levelfullname=Forged Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_03.png<!--
-->|credits|value|price=472<!--
-->|usecost|useprice=900<!--
-->|upgradecost|upgradeprice=1350<!--
-->|howget|howtoget=<div>Combine 4 Pressed Desh Scraps.</div><div>Low level and repeatable missions.</div><div>Minor reward level missions.</div><div>The <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Supply_Crane|Supply Crane]]</span> in exchange for a <span class="class-style color-gray color-link-gray">[[Requisition_scrip|Requisition Scrip]]</span>.</div><!--
-->|xp=6724<!--
-->}}<!--
-->|plated|plateddesh scraps|plated desh scraps|plateddeshscraps|plated deshscraps|4={{#switch:{{lc:{{{get|}}}}}<!--
-->|prefix|levelname=Plated<!--
-->|level|baselevel|levelnum=4<!--
-->|fullname|levelfullname=Plated Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_04.png<!--
-->|credits|value|price=1417<!--
-->|usecost|useprice=2700<!--
-->|upgradecost|upgradeprice=4050<!--
-->|howget|howtoget=<div>Combine 4 Forged Desh Scraps.</div><div>Low level and repeatable missions.</div><div>The <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Supply_Crane|Supply Crane]]</span> in exchange for a <span class="class-style color-gray color-link-gray">[[Requisition_scrip|Requisition Scrip]]</span> or <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Chromium|Chromium]]</span>.</div><!--
-->|xp=27568<!--
-->}}<!--
-->|welded|weldeddesh scraps|welded desh scraps|weldeddeshscraps|welded deshscraps|5={{#switch:{{lc:{{{get|}}}}}<!--
-->|prefix|levelname=Welded<!--
-->|level|baselevel|levelnum=5<!--
-->|fullname|levelfullname=Welded Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_05.png<!--
-->|credits|value|price=4252<!--
-->|usecost|useprice=8100<!--
-->|upgradecost|upgradeprice=12150<!--
-->|howget|howtoget=<div>Combine 4 Plated Desh Scraps.</div><div>Best reward level missions.</div><div>The <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Supply_Crane|Supply Crane]]</span> in exchange for a <span class="class-style color-gray color-link-gray">[[Requisition_scrip|Requisition Scrip]]</span> or <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Chromium|Chromium]]</span>.</div><!--
-->|xp=113030<!--
-->}}<!--
-->|fused|fuseddesh scraps|fused desh scraps|fuseddeshscraps|fused deshscraps|6={{#switch:{{lc:{{{get|}}}}}<!--
-->|prefix|levelname=Fused<!--
-->|level|baselevel|levelnum=6<!--
-->|fullname|levelfullname=Fused Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_06.png<!--
-->|credits|value|price=12757<!--
-->|usecost|useprice=24300<!--
-->|upgradecost|upgradeprice=36450<!--
-->|howget|howtoget=<div>Combine 4 Welded Desh Scraps.</div><div>The <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Supply_Crane|Supply Crane]]</span> in exchange for <span class="class-style color-gray color-link-gray">[[Wookieepedia:Star_Wars:_Uprising_Super_Walkthrough/Chromium|Chromium]]</span>.</div><!--
-->|xp=463424<!--
-->}}<!--
-->|hardened|hardeneddesh scraps|hardened desh scraps|hardeneddeshscraps|hardened deshscraps|7={{#switch:{{lc:{{{get|}}}}}<!--
-->|prefix|levelname=Hardened<!--
-->|level|baselevel|levelnum=7<!--
-->|fullname|levelfullname=Hardened Desh Scraps<!--
-->|icon|image=Uprising_UI_Prop_Material_Generic_07.png<!--
-->|credits|value|price=38272<!--
-->|usecost|useprice=72900<!--
-->|upgradecost|upgradeprice=<!--
-->|howget|howtoget=<div>Combine 4 Fused Desh Scraps.</div><!--
-->|xp=1900041<!--
-->}}<!--
If no level was matched, the full name is simply the component's baseName
Also, if no level is matched, a default icon is returned when "icon" or "image" is requested
-->|#default={{#switch:{{lc:{{{get|}}}}}<!--
-->|fullname=Desh Scraps<!--
-->|defaulticon|defaultimage|icon|image=Uprising_UI_Prop_Material_Generic_07.png<!--
-->}}<!--
-->}}<!--
The following is basic categorization, and template page's doc page tranclusion (AKA what you are reading). DO NOT CHANGE!
-->}}</onlyinclude><noinclude>[[Category:Component Data Templates for Star Wars: Uprising]][[Category:Material Data Templates for Star Wars: Uprising]]{{UprisingComponents|get=box|baseName=Desh Scraps}}<br>{{Documentation|NOTOC=1|docName=Component Template Documentation|docPath=UprisingComponents/doc2}}
__NOTOC__
</noinclude>
Switch Values
A "switch" statement in programming is just (in its simplest form) a fast, compact way to compare a single value to a large number of test cases. All the data is stored as return values for these switch statements.
The redundant naming scheme serves two purposes:
- Idiot proofing
- It allows simplification for caller function when passing values along the chain. I don't know how to explain it any better than that, but it is important that all the alias names are present. In short: it makes my life easier developing these templates.
All test cases are lowercase!
Another bit of idiot proofing is just making the request case-insensitive by converting it to lowercase before each comparison.
{