package me.hammerle.supersnuvi.gamelogic;

public class Point implements Comparable<Point>
{
    private final int x;
    private final int y;
    
    public Point(int x, int y)
    {
        this.x = x;
        this.y = y;
    }

    public int getX() 
    {
        return x;
    }

    public int getY() 
    {
        return y;
    }

    @Override
    public int compareTo(Point o) 
    {
        if(x > o.x)
        {
            return 1;
        }
        else if(x < o.x)
        {
            return -1;
        }
        else if(y > o.y)
        {
            return 1;
        }
        else if(y < o.y)
        {
            return -1;
        }
        return 0;
    }

    @Override
    public String toString() 
    {
        StringBuilder sb = new StringBuilder();
        sb.append("(");
        sb.append(x);
        sb.append(", ");
        sb.append(y);
        sb.append(")");
        return sb.toString();
    }
}
