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:
54
lib/slick-source/org/newdawn/slick/command/BasicCommand.java
Normal file
54
lib/slick-source/org/newdawn/slick/command/BasicCommand.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package org.newdawn.slick.command;
|
||||
|
||||
/**
|
||||
* A simple named command
|
||||
*
|
||||
* @author kevin
|
||||
*/
|
||||
public class BasicCommand implements Command {
|
||||
/** The name of the command */
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Create a new basic command
|
||||
*
|
||||
* @param name The name to give this command
|
||||
*/
|
||||
public BasicCommand(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name given for this basic command
|
||||
*
|
||||
* @return The name given for this basic command
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
public int hashCode() {
|
||||
return name.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
public boolean equals(Object other) {
|
||||
if (other instanceof BasicCommand) {
|
||||
return ((BasicCommand) other).name.equals(name);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return "[Command="+name+"]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user