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 getX()
	{
		return x;
	}
	
	@Override
	public int getY()
	{
		return y;
	}
	
	@Override
	public int getZ()
	{
		return z;
	}
	
	@Override
	public int getW()
	{
		return w;
	}
	
	@Override
	public Vec4i setX(int x)
	{
		this.x = x;
		return this;
	}
	
	@Override
	public Vec4i setY(int y)
	{
		this.y = y;
		return this;
	}
	
	@Override
	public Vec4i setZ(int z)
	{
		this.z = z;
		return this;
	}
	
	@Override
	public Vec4i setW(int w)
	{
		this.w = w;
		return this;
	}
	
	@Override
	public Vec4i copy()
	{
		return Vec4i.newMutable(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.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w;
		}
		return false;
	}
	
	@Override
	public String toString()
	{
		return "Vec4i[x="+x+", y="+y+", z="+z+", w="+w+"]";
	}
}
