Template:Code Reference: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
m (Heladodebrownie moved page Template:Part Reference to Template:Code Reference: more apt name)
m (replace references to Part Reference with Code Reference)
Line 1: Line 1:
<noinclude>This template is used for cohesive citation of the game's C# classes. It's called like so:
<noinclude>This template is used for cohesive citation of the game's C# classes. It's called like so:


<pre><nowiki>{{Part Reference
<pre><nowiki>{{Code Reference
| namespace = Fake.Namespace
| namespace = Fake.Namespace
| class    = FakeClass
| class    = FakeClass
Line 9: Line 9:
All parameters except <code>class</code> can usefully be omitted:
All parameters except <code>class</code> can usefully be omitted:


* If <code>class</code> is missing, the page will be tagged with [[:Category:Pages with part reference errors]].
* If <code>class</code> is missing, the page will be tagged with [[:Category:Pages with code reference errors]].
* If <code>namespace</code> is missing, it defaults to <code>XRL.World.Parts</code>.
* If <code>namespace</code> is missing, it defaults to <code>XRL.World.Parts</code>.
* If <code>method</code> is missing, the descriptive text related to it is omitted.
* If <code>method</code> is missing, the descriptive text related to it is omitted.


The above example results in the following citation:{{Part Reference
The above example results in the following citation:{{Code Reference
| namespace = Fake.Namespace
| namespace = Fake.Namespace
| class    = FakeClass
| class    = FakeClass
| method    = FakeMethod
| method    = FakeMethod
}}</noinclude><includeonly>{{#if:{{{class|}}}|{{#tag:ref|<code>{{{namespace|XRL.World.Parts}}}.{{{class}}}{{#if:{{{method|}}}|, method {{{method}}}}}</code>}}|[[Category:Pages with part reference errors]]}}</includeonly>
}}</noinclude><includeonly>{{#if:{{{class|}}}|{{#tag:ref|<code>{{{namespace|XRL.World.Parts}}}.{{{class}}}{{#if:{{{method|}}}|, method {{{method}}}}}</code>}}|[[Category:Pages with code reference errors]]}}</includeonly>

Revision as of 06:30, 1 August 2020

This template is used for cohesive citation of the game's C# classes. It's called like so:

{{Code Reference
| namespace = Fake.Namespace
| class     = FakeClass
| method    = FakeMethod
}}

All parameters except class can usefully be omitted:

  • If class is missing, the page will be tagged with Category:Pages with code reference errors.
  • If namespace is missing, it defaults to XRL.World.Parts.
  • If method is missing, the descriptive text related to it is omitted.

The above example results in the following citation:[1]

  1. Fake.Namespace.FakeClass, method FakeMethod