Template:Struct field/doc: Difference between revisions

From SlyMods
Jump to navigation Jump to search
Content added Content deleted
(Added templatedata and see also)
(Update template doc)
Line 1: Line 1:
== Usage ==
== Usage ==
<pre>
<pre>
{{Struct|
{{Struct top}}
{{Struct field|offset|size|type|name|description}}
{{Struct field|0x1c|0x4|DifficultyLevel *|''Difficulty level''|Pointer to the current difficulty level}}
{{Struct bottom}}
}}
</pre>
</pre>

{{Struct|
=== Example ===
{{Struct field|0x1c|0x4|DifficultyLevel *|''Difficulty level''|Pointer to the current difficulty level}}
<pre>
}}
{{Struct top}}
{{Struct field|offset=0x1c|size=0x4|type=DifficultyLevel *|name=''Difficulty level''|description=Pointer to the current difficulty level}}
{{Struct bottom}}
</pre>

{{Struct top}}
{{Struct field|offset=0x1c|size=0x4|type=DifficultyLevel *|name=''Difficulty level''|description=Pointer to the current difficulty level}}
{{Struct bottom}}


== Template data ==
== Template data ==
Line 14: Line 22:
{
{
"params": {
"params": {
"offset": {},
"offset": {
"size": {},
"aliases": [
"type": {},
"1"
"name": {},
],
"description": {}
"description": "Offset into the struct in bytes",
"type": "number",
"suggested": true
},
"size": {
"aliases": [
"2"
],
"description": "Size of the field in bytes",
"type": "number",
"suggested": true
},
"type": {
"aliases": [
"3"
],
"description": "The data type of the field",
"example": "int, float, etc.",
"type": "string",
"suggested": true
},
"name": {
"aliases": [
"4"
],
"description": "The name of the field",
"type": "string",
"suggested": true
},
"description": {
"aliases": [
"5"
],
"description": "Any description or notes about the field",
"type": "string"
}
},
},
"description": "A template for rows in the {{tl|Struct}} template"
"description": "A template for rows in the {{tl|Struct}} template",
"format": "inline"
}
}
</templatedata>
</templatedata>

Revision as of 15:38, 23 September 2023

Usage

{{Struct top}}
{{Struct field|offset|size|type|name|description}}
{{Struct bottom}}

Example

{{Struct top}}
{{Struct field|offset=0x1c|size=0x4|type=DifficultyLevel *|name=''Difficulty level''|description=Pointer to the current difficulty level}}
{{Struct bottom}}
Offset Size Type Name Notes
0x1c 0x4
DifficultyLevel *
Difficulty level Pointer to the current difficulty level

Template data

This is the TemplateData documentation for this template used by VisualEditor and other tools.

TemplateData for Struct field

A template for rows in the {{tl|Struct}} template

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
offsetoffset 1

Offset into the struct in bytes

Numbersuggested
sizesize 2

Size of the field in bytes

Numbersuggested
typetype 3

The data type of the field

Example
int, float, etc.
Stringsuggested
namename 4

The name of the field

Stringsuggested
descriptiondescription 5

Any description or notes about the field

Stringoptional

See also