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

import java.util.Objects;

public class Vec4iMutable implements Vec4i {
	int x;
	int y;
	int z;
	int w;
	
	public Vec4iMutable() {}
	
	public Vec4iMutable(int value) {
		x = value;
		y = value;
		z = value;
		w = value;
	}
	
	public Vec4iMutable(int x, int y, int z, int w) {
		this.x = x;
		this.y = y;
		this.z = z;
		this.w = w;
	}
	
	@Override
	public boolean isMutable() { return true; }
	@Override
	public int x() { return x; }
	@Override
	public int y() { return y; }
	@Override
	public int z() { return z; }
	@Override
	public int w() { return w; }
	
	@Override
	public Vec4i x(int x) {
		this.x = x;
		return this;
	}
	
	@Override
	public Vec4i y(int y) {
		this.y = y;
		return this;
	}
	
	@Override
	public Vec4i z(int z) {
		this.z = z;
		return this;
	}
	
	@Override
	public Vec4i w(int w) {
		this.w = w;
		return this;
	}
	
	@Override
	public Vec4i copy() { return Vec4i.mutable(this); }
	
	@Override
	public Vec4i set(int x, int y, int z, int 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 Vec4i) {
			Vec4i vec = (Vec4i)obj;
			return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
		}
		return false;
	}
	
	@Override
	public String toString() { return "Vec4i[x="+x+", y="+y+", z="+z+", w="+w+"]"; }
}
