All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.game.math.IPoint Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating Javascript and Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.5.0
Show newest version
package com.jtransc.game.math;

public class IPoint {
    public int x;
    public int y;

    public IPoint() {
        this(0, 0);
    }

    public IPoint(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public IPoint setTo(int x, int y) {
        this.x = x;
        this.y = y;
        return this;
    }

    public void copyFrom(IPoint that) {
        this.x = that.x;
        this.y = that.y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IPoint that = (IPoint) o;
        return this.x == that.x && this.y == that.y;

    }

    @Override
    public int hashCode() {
        return 31 * x + y;
    }

    @Override
    public String toString() {
        return "IPoint(" + x + ", " + y + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy