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

com.github.mathiewz.slick.command.MouseButtonControl Maven / Gradle / Ivy

Go to download

The main purpose of this libraryis to modernize and maintain the slick2D library.

The newest version!
package com.github.mathiewz.slick.command;

/**
 * A control indicating that a mouse button must be pressed or released to cause an command
 *
 * @author joverton
 */
public class MouseButtonControl implements Control {
    /** The button to be pressed */
    private final int button;

    /**
     * Create a new control that indicates a mouse button to be pressed or released
     *
     * @param button
     *            The button that should be pressed to cause the command
     */
    public MouseButtonControl(int button) {
        this.button = button;
    }

    /**
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object o) {
        if (o instanceof MouseButtonControl) {
            return ((MouseButtonControl) o).button == button;
        }

        return false;
    }

    /**
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        return button;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy