Template:Code Reference: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
m (replace references to Part Reference with Code Reference)
m (add Category:Templates)
Line 17: Line 17:
| 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 code reference errors]]}}</includeonly>
}}
 
[[Category:Templates]]</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 07:10, 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