Difference between revisions of "Template:Property"
From Kerbal Space Program Wiki
(Created page with "|- | <span style="color:green;">{{{type}}}</span> {{{name}}} | {{{desc|<small>?</small>}}}") |
|||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |- | + | <includeonly>|- |
− | | <span style="color: | + | | <tt>{{{type}}} {{{name}}} { {{#if:{{{hasget|}}}|<span style="color:blue;">get;</span> }}{{#if:{{{hasset|}}}|<span style="color:blue;">set;</span> }}}</tt> |
− | | {{{desc|<small>?</small>}}} | + | | {{{desc|<small>?</small>}}}</includeonly><noinclude> |
+ | '''Template:Property''' is a single property as listed inside a [[Template:Properties]] template on a class API page. | ||
+ | |||
+ | ===Parameters=== | ||
+ | :'''name''' - Required. The name of this property. | ||
+ | :'''type''' - Required. Pass a single [[Template:Type]], '''do not pass a string type name, use the Type template!'''. | ||
+ | :'''hasget''' - Optional. Set to "true" if this property has a getter, leave blank otherwise. | ||
+ | :'''hasset''' - Optional. Set to "true" if this property has a setter, leave blank otherwise. | ||
+ | :'''access''' - Optional. Set to "public" or "protected". | ||
+ | :'''static''' - Optional. Set to "true" for static properties, leave blank otherwise. | ||
+ | :'''desc''' - Optional. Set to description of this property. | ||
+ | |||
+ | ===Examples=== | ||
+ | {{Properties|properties= | ||
+ | {{Property | ||
+ | |name=SomeProperty | ||
+ | |type={{Type|type=Vessel}} | ||
+ | |hasget=true | ||
+ | }} | ||
+ | {{Property | ||
+ | |name=SomeOtherProperty | ||
+ | |type={{Type|type=Vessel}} | ||
+ | |hasget=true | ||
+ | |hasset=true | ||
+ | |access=protected | ||
+ | |static=true | ||
+ | }} | ||
+ | }} | ||
+ | |||
+ | [[Category:Templates]] | ||
+ | [[Category:API Templates]] | ||
+ | </noinclude> |
Latest revision as of 00:59, 17 October 2015
Template:Property is a single property as listed inside a Template:Properties template on a class API page.
Parameters
- name - Required. The name of this property.
- type - Required. Pass a single Template:Type, do not pass a string type name, use the Type template!.
- hasget - Optional. Set to "true" if this property has a getter, leave blank otherwise.
- hasset - Optional. Set to "true" if this property has a setter, leave blank otherwise.
- access - Optional. Set to "public" or "protected".
- static - Optional. Set to "true" for static properties, leave blank otherwise.
- desc - Optional. Set to description of this property.
Examples
Properties
The following is a list of properties in Property.
Name | Description |
---|---|
Vessel SomeProperty { get; } | ? |
Vessel SomeOtherProperty { get; set; } | ? |