make Vector2 constructor private

This commit is contained in:
dfsek
2021-12-20 00:08:30 -07:00
parent fb6c86801e
commit 026547bdfc
14 changed files with 19 additions and 17 deletions

View File

@@ -25,11 +25,15 @@ public class Vector2 implements Cloneable {
* @param x X component
* @param z Z component
*/
public Vector2(double x, double z) {
private Vector2(double x, double z) {
this.x = x;
this.z = z;
}
public static Vector2 of(double x, double z) {
return new Vector2(x, z);
}
/**
* Multiply X and Z components by a value.
*