Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/gamecore/input/Action.java

37 lines
464 B

package mightypork.gamecore.input;
/**
* Triggered action
*
* @author MightyPork
*/
public abstract class Action implements Runnable {
private boolean enabled = true;
/**
* Enable the action
*
* @param enable true to enable
*/
public final void enable(boolean enable)
{
this.enabled = enable;
}
@Override
public final void run()
{
if (enabled) execute();
}
/**
* Do the work.
*/
public abstract void execute();
}