mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
added sources for Slick
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package org.newdawn.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 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)
|
||||
*/
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof MouseButtonControl)
|
||||
{
|
||||
return ((MouseButtonControl)o).button == button;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
public int hashCode() {
|
||||
return button;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user