Difference between revisions of "Template:Db"

From StarMade Wiki
m
m
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#if:{{{2|}}}|<!--
+
{{#if:{{{1|}}}|{{#switch:{{padleft:|1|{{{1}}}}} <!-- Verify if version is requested by ~, then shift all parameters numbers -->
-->{{#switch:{{{2|}}}<!-- determine the good database file to request.
+
|~ ={{#if:{{{3|}}}|<!-- 2 templates to request in each databases to not make loop by requesting in Main info of value of Sub table.
-->|link|type|icon|Factory|Animated|Armor|AHP|SHP|Transparency|InShop|ReactorHp|Mass|Hp|cat|cat2|cat3|cat4|Placable|BlockStyle|Light|Deprecated|LightColor=Db/<!--
+
-->{{#switch:{{{3|}}}
-->{{Db/Version{{#if:{{{3|}}}|{{!}}{{{3}}}}}}}/Main|<!-- if requested a version transmit it to : Db/Version
+
|link|type|icon|textureId|Factory|Heat|Kinetic|EM|Animated|Armor|AHP|SHP|FactoryBakeTime|Transparency|InShop|ReactorHp|Mass|Hp|cat|cat2|cat3|cat4|Placable|BlockStyle|Light|IndivSides|HasActivationTexture|Deprecated|LightColor={{Db/{{Db/Version|{{{1}}}}}Main|{{{2}}}|{{{3}}}|{{{4}}}}}<!-- if requested a version transmit it to : Db/Version-->
-->|Item|CtrlBy|Ctrling|Price|Desc|BlockResourceType|FactoryBakeTime|Chamber|Volume|InRecipe|MainCtrl|SupportCtrl|EffectCtrl|ExpAbsorb=Db/<!--
+
|Unknow "{{{3}}}" : link, Id, Factory, Animated, Armor, Ahp, Shp, Transparency, InShop, ReactorHp, Mass, Hp, cat, cat2, cat3, cat4, Placable, BlockStyle, HasActivationTexture, IndivSides, Light, Depreciated, LightColor}}<!--
-->{{Db/Version{{#if:{{{3|}}}|{{!}}{{{3}}}}}}}/Sub|<!-- if request a version, transmit it to : Db/Version<!--
+
-->| Db must get a type with version}}
-->|Unknow request data : link, type, Factory, Animated, Armor, AHP, SHP, Transparency, InShop, ReactorHp, Mass, Hp, cat, cat2, cat3, cat4, Placable, BlockStyle, Light, Deprecated, LightColor, Item, CtrlBy, Price, Desc, BlockResourceType, FactoryBakeTime, Chamber, Volume, InRecipe, MainCtrl, SupportCtrl, EffectCtrl, ExpAbsorb}}<!--
+
|{{#switch:{{{2|}}}
-->| You must specify a request !}}
+
|link|type|icon|textureId|Factory|Heat|Kinetic|EM|Animated|Armor|AHP|SHP|FactoryBakeTime|Transparency|InShop|ReactorHp|Mass|Hp|cat|cat2|cat3|cat4|Placable|BlockStyle|Light|IndivSides|HasActivationTexture|Deprecated|LightColor={{Db/{{Db/Version}}Main|{{{1}}}|{{{2}}}|{{{3}}}}}
 +
|Unknow "{{{2}}}" : link, Id, Factory, Animated, Armor, Shp, Shp, Transparency, FactoryBakeTime, Heat, Kinetic, EM, InShop, ReactorHp, Mass, Hp, cat, cat2, cat3, cat4, Placable, BlockStyle,HasActivationTexture, IndivSides, Light, Depreciated, LightColor}} }}| No request to Db}}<!--
 +
--><noinclude>{{Documentation}}</noinclude>

Latest revision as of 22:15, 27 July 2018

No request to Db

[view] [edit] [history] [[[:Template:Purge]]] 50px Template documentation

Database of blocks is transformed from game datafiles. Two file (Main and Sub) are generated to reduce case by blocks.

structure : Template:Db/Version/0.xxx.xxx/file

file are Main and Sub


DbParser rename unwanted type, handle image options and send to Db or DbSub parsing the request type.

Db and DbSub request the page (Main and Sub) who have data and ask to Version wich version (folder ) go to. 2 template are created to avoid loops when ask for table on sub, who request data of main. So, for developpement of tempaltes, it's better to directly query Db or DbSub isntead of DbParser to avoid loops if table of Sub data are used.

Version return LastVersion or the version ask.

Db/LastVersion store the default version.

'"Main"' and '"Sub"' are stored in 0.xxx.xxx and divise data of each blocks to light process and allow loop request when requesting a table.