package speiger.src.coreengine.math.vector.longs;

import java.util.Objects;

public class Vec4lMutable implements Vec4l {
	long x;
	long y;
	long z;
	long w;
	
	public Vec4lMutable() {}
	
	public Vec4lMutable(long value) {
		x = value;
		y = value;
		z = value;
		w = value;
	}
	
	public Vec4lMutable(long x, long y, long z, long w) {
		this.x = x;
		this.y = y;
		this.z = z;
		this.w = w;
	}
	
	@Override
	public boolean isMutable() { return true; }
	@Override
	public long x() { return x; }
	@Override
	public long y() { return y; }
	@Override
	public long z() { return z; }
	@Override
	public long w() { return w; }
	
	@Override
	public Vec4l x(long x) {
		this.x = x;
		return this;
	}
	
	@Override
	public Vec4l y(long y) {
		this.y = y;
		return this;
	}
	
	@Override
	public Vec4l z(long z) {
		this.z = z;
		return this;
	}
	
	@Override
	public Vec4l w(long w) {
		this.w = w;
		return this;
	}
	
	@Override
	public Vec4l copy() { return Vec4l.mutable(this); }
	
	@Override
	public Vec4l set(long x, long y, long z, long w) {
		this.x = x;
		this.y = y;
		this.z = z;
		this.w = w;
		return this;
	}
	
	@Override
	public int hashCode() { return Objects.hash(x, y, z, w); }
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Vec4l) {
			Vec4l vec = (Vec4l)obj;
			return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
		}
		return false;
	}
	
	@Override
	public String toString() { return "Vec4l[x="+x+", y="+y+", z="+z+", w="+w+"]"; }
}
