/
area/
classes/net/sourceforge/pain/logic/
classes/net/sourceforge/pain/logic/event/
classes/net/sourceforge/pain/logic/fn/util/
classes/net/sourceforge/pain/network/console/
classes/net/sourceforge/pain/plugin/
classes/net/sourceforge/pain/plugin/reset/
classes/net/sourceforge/pain/plugin/shutdown/
classes/net/sourceforge/pain/plugin/social/
classest/net/sourceforge/pain/db/data/
doc/
doc/paindb/resources/
src/net/sourceforge/pain/logic/
src/net/sourceforge/pain/logic/event/
src/net/sourceforge/pain/logic/fn/util/
src/net/sourceforge/pain/network/console/
src/net/sourceforge/pain/network/console/telnet/
src/net/sourceforge/pain/plugin/
src/net/sourceforge/pain/plugin/command/
src/net/sourceforge/pain/plugin/reset/
src/net/sourceforge/pain/plugin/shutdown/
src/net/sourceforge/pain/plugin/social/
src/net/sourceforge/pain/util/
tests/
tests/net/sourceforge/pain/db/data/
package net.sourceforge.pain.logic.event.console.command;

import net.sourceforge.pain.logic.event.console.*;

import java.util.*;

public abstract class GrantedCommand extends CommandHandler {

	public boolean isAccessible() {
		if (!super.isAccessible()) {
			return false;
		}
		final Set grantedCommands = player.getGrantedCommands();
		if (grantedCommands.contains("_all")) {// implementor mark
			return true;
		}
		String grantedCommandClass = getClass().getName().substring(ConsoleInputEvent.COMMAND_PACKAGE.length());
		if (grantedCommands.contains(grantedCommandClass)) {
			return true;
		}
		return false;
	}

	/** Empty. subclasses should override this method to make some specific work here*/
	public void onGrantAdded() throws Exception {

	}

	/** Empty. subclasses should override this method to make some specific work here*/
	public void onGrantRemoved() throws Exception {
	}
}