Difference between revisions of "Template:Modarg"

From DoomRL Wiki

Jump to: navigation, search
m (hopefully a link fix)
 
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#switch: {{{1}}}
+
<noinclude>
   | {{#if: {{#pos:{{{1}}}|Coord}}|{{#sub:{{{1}}}|0|5}}}} =  '''[[Modding:Coord|{{{1}}}]]'''
+
Whenever an input or output argument is required for an API function, one should use <nowiki>{{modarg|arg}}</nowiki> to express it. This also handles cases where links are required. Some examples:
   | {{#if: {{#pos:{{{1}}}|Area}}|{{#sub:{{{1}}}|0|4}}}}  =  '''[[Modding:Area|{{{1}}}]]'''
+
*<nowiki>{{modarg|integer}}</nowiki> &rarr; '''integer'''
   | {{#if: {{#pos:{{{1}}}|Item}}|{{#sub:{{{1}}}|0|4}}}}  =  '''[[Modding:Item|{{{1}}}]]'''
+
*<nowiki>{{modarg|Being}}</nowiki> &rarr; '''[[Modding:Being|Being]]'''
   | {{#if: {{#pos:{{{1}}}|Being}}{{#sub:{{{1}}}|0|5}}}}  =  '''[[Modding:Being|{{{1}}}]]'''
+
*<nowiki>{{modarg|CoordList}}</nowiki> &rarr; '''[[Modding:Coord|CoordList]]'''
   | {{#if: {{#pos:{{{1}}}|Player}}{{#sub:{{{1}}}|0|6}}}} =  '''[[Modding:Player|{{{1}}}]]'''
+
If there are more links required, feel free to add a line to the template.
   | {{#if: {{#pos:{{{1}}}|Room}}|{{#sub:{{{1}}}|0|4}}}}  =  '''[[Modding:Generator|{{{1}}}]]'''
+
</noinclude>{{#switch: {{{1}}}
   | '''{{{1}}}'''
+
   | {{#if: {{#pos:{{{1}}}|Affect}}       |{{{1}}} }} =  '''[[Modding:Affect|{{{1}}}]]'''
}} {{{2}}},
+
  | {{#if: {{#pos:{{{1}}}|affect}}      |{{{1}}} }} =  '''[[Modding:Affect|{{{1}}}]]'''
 +
   | {{#if: {{#pos:{{{1}}}|AI}}           |{{{1}}} }} =  '''[[Modding:AI|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|ai}}          |{{{1}}} }} = '''[[Modding:AI|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|AltFire}}      |{{{1}}} }} =  '''[[Modding:Constants#AltFire|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|altfire}}      |{{{1}}} }} =  '''[[Modding:Constants#AltFire|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|AltReload}}    |{{{1}}} }} =  '''[[Modding:Constants#AltReload|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|altreload}}    |{{{1}}} }} =  '''[[Modding:Constants#AltReload|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Area}}        |{{{1}}} }} =  '''[[Modding:Area|{{{1}}}]]'''
 +
   | {{#if: {{#pos:{{{1}}}|area}}         |{{{1}}} }} =  '''[[Modding:area|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Badge}}        |{{{1}}} }} = '''[[Modding:Badge|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|badge}}        |{{{1}}} }} =  '''[[Modding:Badge|{{{1}}}]]'''
 +
   | {{#if: {{#pos:{{{1}}}|Being Flag}}   |{{{1}}} }} =  '''[[Modding:Constants#Being Flag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|being flag}}  |{{{1}}} }} = '''[[Modding:Constants#Being Flag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Being}}        |{{{1}}} }} =  '''[[Modding:Being|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|being}}        |{{{1}}} }} =  '''[[Modding:being|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Cell Flags}}  |{{{1}}} }} =  '''[[Modding:Cell#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|cell flags}}  |{{{1}}} }} =  '''[[Modding:Cell#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Cellset}}      |{{{1}}} }} =  '''[[Modding:Constants#Cellsets|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|cellset}}      |{{{1}}} }} =  '''[[Modding:Constants#Cellsets|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Cell}}        |{{{1}}} }} =  '''[[Modding:Cell|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|cell}}        |{{{1}}} }} =  '''[[Modding:cell|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Color Set}}    |{{{1}}} }} =  '''[[Modding:Color#Color Sets|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|color set}}    |{{{1}}} }} =  '''[[Modding:Color#Color Sets|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Color}}        |{{{1}}} }} =  '''[[Modding:Color#Console Colors|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|color}}        |{{{1}}} }} =  '''[[Modding:Color#Console Colors|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Coord}}        |{{{1}}} }} =  '''[[Modding:Coord|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|coord}}        |{{{1}}} }} =  '''[[Modding:coord|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|DamageType}}  |{{{1}}} }} =  '''[[Modding:Constants#DamageType|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|damagetype}}  |{{{1}}} }} =  '''[[Modding:Constants#DamageType|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Empty Flag}}  |{{{1}}} }} =  '''[[Modding:Constants#Empty Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|empty flag}}  |{{{1}}} }} =  '''[[Modding:Constants#Empty Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Explosion Flag}}|{{{1}}} }} =  '''[[Modding:Constants#ExplosionFlag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|fxplosion flag}}|{{{1}}} }} =  '''[[Modding:Constants#ExplosionFlag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Flag}}        |{{{1}}} }} =  '''[[Modding:Constants#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|flag}}        |{{{1}}} }} =  '''[[Modding:Constants#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Item Flag}}    |{{{1}}} }} =  '''[[Modding:Item#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|item flag}}    |{{{1}}} }} =  '''[[Modding:Item#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|ItemSet}}      |{{{1}}} }} =  '''[[Modding:ItemSet|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|itemset}}      |{{{1}}} }} =  '''[[Modding:ItemSet|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|ItemType}}    |{{{1}}} }} =  '''[[Modding:Constants#ItemType|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|itemtype}}    |{{{1}}} }} =  '''[[Modding:Constants#ItemType|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Item}}        |{{{1}}} }} =  '''[[Modding:Item|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|item}}        |{{{1}}} }} =  '''[[Modding:item|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Klass}}        |{{{1}}} }} =  '''[[Modding:Klass|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|klass}}        |{{{1}}} }} =  '''[[Modding:Klass|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Level Flag}}  |{{{1}}} }} =  '''[[Modding:Constants#Level Flag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|level flag}}  |{{{1}}} }} =  '''[[Modding:Constants#Level Flag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Light Flag}}  |{{{1}}} }} =  '''[[Modding:Constants#Light Flag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|light flag}}  |{{{1}}} }} =  '''[[Modding:Constants#Light Flag|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Medal}}        |{{{1}}} }} =  '''[[Modding:Medal|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|medal}}        |{{{1}}} }} =  '''[[Modding:Medal|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Missile Flag}} |{{{1}}} }} =  '''[[Modding:Missile#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|missile flag}} |{{{1}}} }} =  '''[[Modding:Missile#Flags|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Missile}}      |{{{1}}} }} =  '''[[Modding:Missile|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|missile}}      |{{{1}}} }} =  '''[[Modding:Missile|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|ModArray}}    |{{{1}}} }} =  '''[[Modding:ModArray|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|modArray}}    |{{{1}}} }} =  '''[[Modding:ModArray|{{{1}}}]]'''
 +
   | {{#if: {{#pos:{{{1}}}|Player}}       |{{{1}}} }} =  '''[[Modding:Player|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|player}}      |{{{1}}} }} =  '''[[Modding:Player|{{{1}}}]]'''
 +
   | {{#if: {{#pos:{{{1}}}|Range}}       |{{{1}}} }} =  '''[[Modding:core/functions:resolverange|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|range}}        |{{{1}}} }} = '''[[Modding:core/functions:resolverange|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Resistance}}  |{{{1}}} }} =  '''[[Modding:Constants#Resistance|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|resistance}}  |{{{1}}} }} =  '''[[Modding:Constants#Resistance|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Room}}        |{{{1}}} }} =  '''[[Modding:Generator|{{{1}}}]]'''
 +
   | {{#if: {{#pos:{{{1}}}|room}}        |{{{1}}} }} =  '''[[Modding:Generator|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Sprite}}      |{{{1}}} }} =  '''[[Modding:Sprites|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|sprite}}      |{{{1}}} }} =  '''[[Modding:Sprites|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|StatusEffect}} |{{{1}}} }} =  '''[[Modding:Constants#StatusEffect|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|Trait}}        |{{{1}}} }} =  '''[[Modding:Trait|{{{1}}}]]'''
 +
  | {{#if: {{#pos:{{{1}}}|trait}}        |{{{1}}} }} =  '''[[Modding:Trait|{{{1}}}]]'''
 +
  | <b>{{{1}}}</b>
 +
}}

Latest revision as of 22:47, 21 April 2013

Whenever an input or output argument is required for an API function, one should use {{modarg|arg}} to express it. This also handles cases where links are required. Some examples:

  • {{modarg|integer}} → integer
  • {{modarg|Being}} → Being
  • {{modarg|CoordList}} → CoordList

If there are more links required, feel free to add a line to the template. {{{1}}}

Personal tools