/space-engineers-doc-collab

Collaborative Space Engineers in-game API documentation project

Primary LanguageC#

space-engineers-doc-collab



READ:

KeenSWH has began generating this documentation as of 01.068 (5.2.2015). The file Documentation.chm can be found from the Tools folder in your main Space Engineers folder.



Current version: 01.067.007 30.1.2015

This is a collaborative Space Engineers in-game API documentation project. Our goal is to accurately document the in-game API's features to make development easier for everyone - online documentation is generated with Sandcastle Help File Builder. Altenatively, a Compiled HTML Help (.chm) file has been created for easier offline viewing. This file can be found in the root folder.

Contributing to the project

First of all, you'll need to fork, clone or download this repository. You can help by adding XML summaries above fields, properties, methods, interfaces, etc. which explain usage. Example summary:

// ModAPI\Interfaces\IMyInventory.cs

/// <summary>
/// Transfers items from the inventory to the target inventory.
/// </summary>
/// <param name="dst">Target inventory</param>
/// <param name="sourceItemIndex">Index of the item being transferred in the source inventory</param>
/// <param name="targetItemIndex">Index to which the item will be placed in the target inventory</param>
/// <param name="stackIfPossible"></param>
/// <param name="amount">Amount of items to transfer</param>
/// <returns></returns>
/// <remarks>
/// 	<note type="caution">When using this method in a loop, the item indexes will change as the inventory automatically fills the empty inventory spaces left by item transfers. It is thus recommended to set <paramref name="sourceItemIndex"/> to zero when iterating over every element in the inventory.</note>
/// </remarks>
/// <example>
/// 	The following example demonstrates the <c>TransferItemTo</c> method.
/// 	<code source="Examples\Interfaces.IMyInventory.TransferItemTo.cs" lang="cs"></code>
/// </example>
bool TransferItemTo(IMyInventory dst, int sourceItemIndex, int? targetItemIndex = null, bool? stackIfPossible = null, MyFixedPoint? amount = null);

The example code snippet can also be placed inside the <code> tags, in the case of which the source attribute would be left out. The above will also include a code example from the file Interfaces.IMyInventory.TransferItemTo.cs. If using a relative path, the Sandcastle Help File Builder will read them relative to the .shfbproj project file's location, hence the Examples folder can be found from the Sandcastle Files folder in this repository.

Please see the XML Comments References in the Links-section for a comprehensive list of supported documentation XML tags.


If something cannot be accessed from the programmable block, please add the following summary above it: ```c# /// /// Inaccessible /// ```

Once you've done your edits, create a pull request or send a PM to Cuber to have the edits reviewed. Thank you!

Utilizing the project

The latest documentation build can always be found from this KeenSWH forum thread. The documentation is a compilation of HTML files, viewable on any device with a web browser and local file access.

Preview of the documentation [imgur.com]

This project can also be compiled to produce the XML file, which will allow your IDE to show the documentation with its autocomplete feature. For example, the summary above will show like this in Visual Studio (click to view full size):

In Visual Studio, the XML documentation generation can be enabled like so: Project tab -> Sandbox.Common Properties -> Build tab -> Output section -> Tick "XML documentation file"

Links

XML Comments References

*Space Engineers® is trademark of KEEN SWH LTD.*