1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/simulation/helpers/InitGame.js
Ykkrosh dd501b2a5a # Add initial basic player AI framework.
Support direct access to serializer streams, so serializers can be
nested.
Make component script "this.template" read-only.
Stop globally-subscribed component scripts receiving messages posted to
local components, to reduce out-of-sync risks.
Move pathfinder data out of entity template directory.
Fix GuiInterface deserialization.

This was SVN commit r8865.
2011-01-12 12:29:00 +00:00

15 lines
379 B
JavaScript

function InitGame(settings)
{
// This will be called after the map settings have been loaded,
// before the simulation has started.
var cmpAIManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AIManager);
for (var i = 0; i < settings.AIs.length; ++i)
{
if (settings.AIs[i])
cmpAIManager.AddPlayer(settings.AIs[i], i);
}
}
Engine.RegisterGlobal("InitGame", InitGame);