1
0
forked from mirrors/0ad

Add some documentation about system components. Fixes #3315.

This was SVN commit r17003.
This commit is contained in:
leper
2015-09-11 04:10:26 +00:00
parent fc051d94cc
commit 558695365d
+16 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -32,6 +32,7 @@
- @ref messages
- @ref component-creation
- @ref schema
- @ref system-components
- @ref allowing-js-interfaces
- @ref defining-js-components
- @ref defining-js-interfaces
@@ -237,7 +238,7 @@ Deinit();
@endcode
The order of <code>Init</code>/<code>Deserialize</code>/<code>Deinit</code> between entities is mostly undefined,
so they must not rely on other entities or components already existing; @em except that the SYSTEM_ENTITY is
so they must not rely on other entities or components already existing; @em except that the @c SYSTEM_ENTITY is
created before anything else and therefore may be used, and that the components for a single entity will be
processed in the order determined by TypeList.h.
@@ -315,6 +316,19 @@ For early development of a new component, you can set the schema to <code>&lt;re
If you don't define @c GetSchema, then the default is <code>&lt;empty/></code> (i.e. there must be no elements).
@subsection system-components System components
System components are global singleton components of the @c SYSTEM_ENTITY.
These are added to it in @c CComponentManager::AddSystemComponents, and
are passed an empty @c paramNode on @c Init.
JS system components can be registered using:
@code
Engine.RegisterSystemComponentType(IID_ExampleSystem, "ExampleSystem", ExampleSystem);
@endcode
@section allowing-js-interfaces Allowing interfaces to be implemented in JS
If we want to allow both C++ and JS implementations of @c ICmpExample,