2010-01-09 11:20:14 -08:00
|
|
|
function TestScript1A() {}
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript1A.prototype.Init = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x = 101000;
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript1A.prototype.GetX = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
return this.x;
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript1A.prototype.OnTurnStart = function(msg)
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x += 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);
|
|
|
|
|
|
|
|
|
|
// -------- //
|
|
|
|
|
|
|
|
|
|
function TestScript1B() {}
|
|
|
|
|
|
2019-09-02 10:33:59 -07:00
|
|
|
TestScript1B.prototype = Object.create(TestScript1A.prototype);
|
2010-01-09 11:20:14 -08:00
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript1B.prototype.Init = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x = 102000;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Engine.RegisterComponentType(IID_Test1, "TestScript1B", TestScript1B);
|
|
|
|
|
|
|
|
|
|
// -------- //
|
|
|
|
|
|
|
|
|
|
function TestScript2A() {}
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript2A.prototype.Init = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x = 201000;
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript2A.prototype.GetX = function()
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
return this.x;
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-30 00:57:37 -08:00
|
|
|
TestScript2A.prototype.OnUpdate = function(msg)
|
|
|
|
|
{
|
2010-01-09 11:20:14 -08:00
|
|
|
this.x += msg.turnLength;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Engine.RegisterComponentType(IID_Test2, "TestScript2A", TestScript2A);
|