1
0
forked from mirrors/0ad

Allow other root XML than entity.

Implements a `GetOnlyChild()`, following discussion at
https://irclogs.wildfiregames.com/%230ad-dev/2022-05-06-QuakeNet-%230ad-dev.log.

Differential revision: https://code.wildfiregames.com/D4738
Comments by: @phosit, @Stan, @vladislavbelov, @wraitii
This was SVN commit r27323.
This commit is contained in:
Freagarach
2022-12-30 07:34:23 +00:00
parent 5044850f93
commit ded41eab31
9 changed files with 26 additions and 9 deletions
@@ -1148,7 +1148,8 @@ std::string CComponentManager::GenerateSchema() const
std::sort(componentTypes.begin(), componentTypes.end());
schema +=
"<start>"
"<element name='Entity'>"
"<element>"
"<anyName/>"
"<optional><attribute name='parent'/></optional>";
for (std::vector<std::string>::const_iterator it = componentTypes.begin(); it != componentTypes.end(); ++it)
schema += "<optional><ref name='component." + *it + "'/></optional>";