skadistats.clarity.model.Vector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarity Show documentation
Show all versions of clarity Show documentation
Clarity is an open source replay parser for Dota 2, CSGO, CS2 and Deadlock written in Java.
package skadistats.clarity.model;
import java.util.Arrays;
public class Vector {
private final float[] v;
public Vector(float... v) {
this.v = v;
}
public int getDimension() {
return v.length;
}
public float getElement(int i) {
return v[i];
}
@Override
public String toString() {
return Arrays.toString(v);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
var vector = (Vector) o;
return Arrays.equals(v, vector.v);
}
@Override
public int hashCode() {
return Arrays.hashCode(v);
}
}