309
edits
Changes
Jump to navigation
Jump to search
→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: "bar" over: 9000@include "some_file_to_include.sui"}}</pre>''some_file_to_include.sui:''<pre> ninjas: true</pre>''How the game “sees” some_file_using_include.sii:''<pre>SiiNUnit{example: doing.includes{ foo: "bar" 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 "some_file_to_include.sui"</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: "bar" @include "dont_get_too_attached_to_indents.sui" foo: @include "you_definitely_cannot_use_it_inline.sui"}}</codepre> that are included somewhere in different files. We recommend you also using this extension.}}
== Attribute types ==