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

de.placeblock.betterinventories.Sizeable Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package de.placeblock.betterinventories;

import de.placeblock.betterinventories.util.Vector2d;

/**
 * Used by GUIs and GUISections for sizing
 */
public interface Sizeable {
    /**
     * @return The size
     */
    Vector2d getSize();

    /**
     * @return The maximum size
     */
    Vector2d getMaxSize();

    /**
     * @return The minimum size
     */
    Vector2d getMinSize();

    /**
     * @param vector The Vector to clamp
     * @return Clamps a Vector to the minimum and maximum
     */
    default Vector2d clampSize(Vector2d vector) {
        return Vector2d.clamp(vector, this.getMinSize(), this.getMaxSize());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy