Ykkrosh
40688ec5df
Add RelaxNG schemas for all current components. Add -dumpSchema command-line option to dump the combined entity schema. Add a Perl script to validate entity templates against the schema. See #413. This was SVN commit r7452.
33 lines
686 B
JavaScript
33 lines
686 B
JavaScript
function Sound() {}
|
|
|
|
Sound.prototype.Schema =
|
|
"<element name='SoundGroups'>" +
|
|
"<zeroOrMore>" +
|
|
"<element>" +
|
|
"<anyName/>" +
|
|
"<text/>" +
|
|
"</element>" +
|
|
"</zeroOrMore>" +
|
|
"</element>";
|
|
|
|
Sound.prototype.Init = function()
|
|
{
|
|
};
|
|
|
|
Sound.prototype.GetSoundGroup = function(name)
|
|
{
|
|
return this.template.SoundGroups[name] || "";
|
|
};
|
|
|
|
Sound.prototype.PlaySoundGroup = function(name)
|
|
{
|
|
if (name in this.template.SoundGroups)
|
|
{
|
|
var cmpSoundManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_SoundManager);
|
|
if (cmpSoundManager)
|
|
cmpSoundManager.PlaySoundGroup(this.template.SoundGroups[name], this.entity);
|
|
}
|
|
};
|
|
|
|
Engine.RegisterComponentType(IID_Sound, "Sound", Sound);
|