Skip to content

Commit

Permalink
[General] Updated Feather data types page on Struct.ConstructorName s…
Browse files Browse the repository at this point in the history
…yntax
  • Loading branch information
gurpreetsinghmatharoo committed Feb 1, 2024
1 parent aa527d2 commit ebb4f4a
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h1>Feather Data Types</h1>
<td><strong>Struct</strong></td>
<td><em>Default</em><span data-keyref="Type_Struct"><a href="../../GameMaker_Language/GML_Overview/Structs.htm" target="_blank">Struct</a></span><br />
...</td>
<td>A struct, may include specifiers</td>
<td>A struct, may include specifiers (such as constructors)</td>
</tr>
<tr>
<td><strong>Id</strong></td>
Expand Down Expand Up @@ -123,15 +123,17 @@ <h1>Feather Data Types</h1>
<p>You may see an <span class="inline2">Any<strong>*</strong></span> type in the IDE when using Feather, which indicates that the type of the identifier (which may be a variable, parameter, return value, etc.) can&#39;t be discerned by Feather at the moment. When more code is added for that identifier, it may be able to assume a specific type.</p>
<h3>Specifiers</h3>
<p>A specifier is added after the base data type using a dot <span class="inline2">.</span>, to specify the exact type of data in that group.</p>
<p>Types such as <span class="inline2">Id.DsList</span>, <span class="inline2">Asset.GMObject</span>, and <span class="inline2">Constant.Color</span> use specifiers. Structs are accessed through the constructor name <span class="inline2">Struct.{Name}</span>. As an example:</p>
<p class="code">function Person() constructor {<br />
<p>Types such as <span class="inline2">Id.DsList</span>, <span class="inline2">Asset.GMObject</span>, and <span class="inline2">Constant.Color</span> use specifiers. Constructors are specified through the syntax <span class="inline2">Struct.{ConstructorName}</span>. For example:</p>
<p class="code">function Person() constructor<br />
{<br />
<br />
}<br />
<br />
/// @param {Struct.Person} _person<br />
function do_business(_person) {<br />
<br />
}<br />
function do_business(_person)<br />
{<br />
<br />
}
</p>
<h3>Collection Types</h3>
<p>Types such as <span class="inline2">Array</span> and <span class="inline2">Id.DsList</span>, which are data structures that contain multiple values, are able to specify a single data type for all of their contents.</p>
Expand Down

0 comments on commit ebb4f4a

Please # to comment.