0ad/binaries/data/mods/_test.sim/globalscripts/test-global-helper.js
Ralph Sennhauser 6aeb09228a
Fix eslint rule 'no-multi-assign'
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-multi-assign": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-06 13:15:10 +02:00

48 lines
542 B
JavaScript

function GlobalSubtractionHelper(a, b)
{
return a-b;
}
function Vector2D(x, y)
{
if (arguments.length == 2)
{
this.x = x;
this.y = y;
}
else
{
this.x = 0;
this.y = 0;
}
}
Vector2D.prototype.add = function(v)
{
this.x += v.x;
this.y += v.y;
return this;
};
function Vector3D(x, y, z)
{
if (arguments.length == 3)
{
this.x = x;
this.y = y;
this.z = z;
}
else
{
this.x = 0;
this.y = 0;
this.z = 0;
}
}
Vector3D.prototype.add = function(v)
{
this.x += v.x;
this.y += v.y;
this.z += v.z;
return this;
};