Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/vector.js
Show All 12 Lines | function Vector2D(x = 0, y = 0) | ||||
this.set(x, y); | this.set(x, y); | ||||
} | } | ||||
Vector2D.prototype.clone = function() | Vector2D.prototype.clone = function() | ||||
{ | { | ||||
return new Vector2D(this.x, this.y); | return new Vector2D(this.x, this.y); | ||||
}; | }; | ||||
// Mutating 2D functions | // Mutating 2D functions | ||||
// | // | ||||
// These functions modify the current object, | // These functions modify the current object, | ||||
// and always return this object to allow chaining | // and always return this object to allow chaining | ||||
Vector2D.prototype.set = function(x, y) | Vector2D.prototype.set = function(x, y) | ||||
{ | { | ||||
this.x = x; | this.x = x; | ||||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator