Example usage for com.badlogic.gdx.utils Array equals

List of usage examples for com.badlogic.gdx.utils Array equals

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils Array equals.

Prototype

public boolean equals(Object object) 

Source Link

Usage

From source file:com.strategames.engine.utils.Level.java

License:Open Source License

@Override
public boolean equals(Object obj) {

    if (obj == null) {
        return false;
    }/*from   ww  w  .  j  a  v  a 2 s .  c  o  m*/

    if (this == obj) {
        return true;
    }

    if (!(obj instanceof Level)) {
        return false;
    }

    Level level = (Level) obj;

    int[] levelPosition = level.getPosition();

    if ((position[0] != levelPosition[0]) || (position[1] != levelPosition[1])) {
        return false;
    }

    Array<int[]> accessiblePos = level.getAccessibleBy();
    if (!accessiblePos.equals(accessibleBy)) {
        return false;
    }

    if (!((worldSize.equals(level.getWorldSize())) && (viewSize.equals(level.getViewSize()))
            && (reachable == level.isReachable()))) {
        return false;
    }

    if (!arrayGameObjectsEquals(level.getGameObjects(), this.gameObjects)) {
        return false;
    }

    Gdx.app.log("Level", "arrayGameObjectsEquals: equals");

    return arrayDoorsEquals(level.getDoors(), this.doors);

}