Changes

Jump to navigation Jump to search

Documentation/Engine/Units

817 bytes added, 17:28, 17 September 2016
Includes: More robust explanation and examples
=== Includes ===
You can also include the contents of other files into another. To do this you need to use using the SII preprocessor directive - <code>@include</code>. The contents of the included file will be read as if they were in the file itself.
'''Example:'''<br />''some_file_using_include.sii''<pre>SiiNUnit{example: doing.includes{ foo: &quot;bar&quot; over: 9000@include &quot;some_file_to_include.sui&quot;}}</pre>''some_file_to_include.sui:''<pre> ninjas: true</pre>''How the game &ldquo;sees&rdquo; some_file_using_include.sii:''<pre>SiiNUnit{example: doing.includes{ foo: &quot;bar&quot; over: 9000 ninjas: true}}</pre>You may notice usage of the new extension - '''.sui'''. It's used for unit serialized files without magic mark <code>SiiNUnit</code> that are included somewhere in different files. We recommend you also using this extension.
{{Note|The <precode>@include &quot;some_file_to_include.sui&quot;</precode>You may notice usage directive must appear at the beginning of the a new extension - line with no whitespace (space, tab, etc) before it. The following examples will '''.suinot'''. It's used for unit serialized files without magic mark work:<codepre>SiiNUnit{bad_examples: just.the.worst { foo: &quot;bar&quot; @include &quot;dont_get_too_attached_to_indents.sui&quot;  foo: @include &quot;you_definitely_cannot_use_it_inline.sui&quot;}}</codepre> that are included somewhere in different files. We recommend you also using this extension.}}
== Attribute types ==
309
edits

Navigation menu