@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
48 lines (38 loc) • 815 B
JavaScript
import Vector2 from "../../../geom/Vector2.js";
export class PortVisualData {
constructor() {
this.id = 0;
/**
*
* @type {Vector2}
*/
this.position = new Vector2();
}
/**
*
* @param {PortVisualData} other
*/
copy(other) {
this.id = other.id;
this.position.copy(other.position);
}
/**
*
* @return {PortVisualData}
*/
clone() {
const r = new PortVisualData();
r.copy(this);
return r;
}
toJSON() {
return {
id: this.id,
position: this.position.toJSON()
};
}
fromJSON(json) {
this.id = json.id;
this.position.fromJSON(json.position);
}
}