mc-beta-server/server/Vec3.ts
2023-04-10 14:42:14 +01:00

19 lines
No EOL
447 B
TypeScript

export class Vec3 {
public x:number;
public y:number;
public z:number;
public constructor(x?:number, y?:number, z?:number) {
if (typeof(x) === "number" && typeof(y) === "number" && typeof(z) === "number") {
this.x = x;
this.y = y;
this.z = z;
} else if (typeof(x) === "number" && typeof(y) !== "number" && typeof(z) !== "number") {
this.x = x;
this.y = x;
this.z = x;
} else {
this.x = this.y = this.z = 0;
}
}
}