Template:Code Reference
Use this template instead of a <ref>
tag if you are citing a class from the game's C# assemblies, such as Assembly-CSharp.dll
. This is useful for cohesively formatting all such code references.
Template Parameter | Required? | Default Value | Notes |
---|---|---|---|
assembly |
No | Assembly-CSharp.dll |
This is currently unused, but ought to be specified anyway if the relevant code is not in the default assembly. |
namespace |
No | XRL.World.Parts |
|
class |
Yes | (None) | This must be specified or else the template will error. |
method |
No | (None) | If provided, a method name will be included in the reference. |
case |
No | (None) | If both this and method are provided, the context will be further narrowed down to a specific conditional case in the given method.
|
property |
No | (None) | If provided, a property name will be included in the reference. This parameter cannot be used in combination with method .
|
comment |
No | (None) | A freeform natural-language addendum that further clarifies or explains the reference. |
name |
No | (None) | If this is present, the citation will be named so that it can be referred to again later by the same name with <ref name="the-name-you-chose" />
|
Usage Examples
Use the following form if you need to reference a part definition:
{{Code Reference | class = FakePart }}
Use the following form if you need to reference a class in a different namespace from XRL.World.Parts
:
{{Code Reference | namespace = Fake.Namespace | class = FakeClass }}
In some cases, it may be useful to additionally specify which method the logic in question occurs in. In that case, use the following form:
{{Code Reference | namespace = Fake.Namespace | class = FakeClass | method = FakeMethod }}
If there are multiple method definitions with the same name, or it otherwise may help to be even more exact, you may append the parameter signature to the name of the method to specify an overload like so:
{{Code Reference | namespace = Fake.Namespace | class = FakeClass | method = FakeMethod(GameObject, GameObject) }}
If it's necessary to be even more specific for a particularly large method (such as a FireEvent
method), you may use the case
parameter:
{{Code Reference | namespace = Fake.Namespace | class = FakeClass | method = FakeMethod(GameObject, GameObject) | case = "Foo" }}
In other cases, it may be useful to specify a property (instead of a method). In that case, use the following form:
{{Code Reference | namespace = Fake.Namespace | class = FakeClass | property = FakeProperty }}
See Also
References
- ↑
XRL.World.Parts.FakePart
- ↑
Fake.Namespace.FakeClass
- ↑
Fake.Namespace.FakeClass
, methodFakeMethod
- ↑
Fake.Namespace.FakeClass
, methodFakeMethod(GameObject, GameObject)
- ↑
Fake.Namespace.FakeClass
, methodFakeMethod(GameObject, GameObject)
, in the"Foo"
case - ↑
Fake.Namespace.FakeClass
, propertyFakeProperty