Template:Struct field/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
TheOnlyZac (talk | contribs) (Added templatedata and see also) |
TheOnlyZac (talk | contribs) (Update template doc) |
||
Line 1: | Line 1: | ||
== Usage == |
== Usage == |
||
<pre> |
<pre> |
||
{{Struct |
{{Struct top}} |
||
{{Struct field|offset|size|type|name|description}} |
|||
⚫ | |||
⚫ | |||
}} |
|||
</pre> |
</pre> |
||
⚫ | |||
=== Example === |
|||
⚫ | |||
<pre> |
|||
}} |
|||
{{Struct top}} |
|||
⚫ | |||
{{Struct bottom}} |
|||
</pre> |
|||
{{Struct top}} |
|||
⚫ | |||
{{Struct bottom}} |
|||
== Template data == |
== Template data == |
||
Line 14: | Line 22: | ||
{ |
{ |
||
"params": { |
"params": { |
||
"offset": { |
"offset": { |
||
" |
"aliases": [ |
||
" |
"1" |
||
], |
|||
"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
Parameter | Description | Type | Status | |
---|---|---|---|---|
offset | offset 1 | Offset into the struct in bytes | Number | suggested |
size | size 2 | Size of the field in bytes | Number | suggested |
type | type 3 | The data type of the field
| String | suggested |
name | name 4 | The name of the field | String | suggested |
description | description 5 | Any description or notes about the field | String | optional |
See also
- {{Struct}}