jmud-0.11/
jmud-0.11/bin/
jmud-0.11/doc/
jmud-0.11/rec/
jmud-0.11/rec/mun/
jmud-0.11/rec/mun/grecia/
jmud-0.11/rec/mun/gunnar/
jmud-0.11/rec/qua/
jmud-0.11/src/bool/
jmud-0.11/src/clone/
jmud-0.11/src/integer/
jmud-0.11/src/misc/
jmud-0.11/src/string/
jmud-0.11/src/util/bit/
jmud-0.11/src/util/color/
jmud-0.11/src/util/file/
jmud-0.11/src/util/jgp/adaptor/
jmud-0.11/src/util/jgp/algorithm/
jmud-0.11/src/util/jgp/container/
jmud-0.11/src/util/jgp/functor/
jmud-0.11/src/util/jgp/interfaces/
jmud-0.11/src/util/jgp/predicate/
jmud-0.11/src/util/log/
jmud-0.11/src/util/state/
jmud-0.11/trash/
import java.util.StringTokenizer;

import util.bit.Bit;

abstract class Command {

    /* options */
    static final int OPT_PLR  = Bit.BIT0;
    static final int OPT_CRT  = Bit.BIT1;

  
    static protected Manager theManager = null;
    static protected World   theWorld   = null;

  static void setManager(Manager aManager) {
    theManager = aManager;
  }

  static void setWorld(World aWorld) {
    theWorld = aWorld;
  }
  
    private String theName = null;
    private int    minRank;
    private int    minPos;
    private int    options;
  
  Command(String name, int mRank, int mPos, int opt) {
    theName = name;
    minRank = mRank;
    minPos  = mPos;
    options = opt;
  }
    
    String getName() {
      return theName;
    }
    
    boolean hasName(String name) {
      return getName().startsWith(name);
    }
    
    int getMinRank() {
      return minRank;
    }

    int getMinPos() {
	return minPos;
    }

    boolean allowPlayer() {
	return Bit.isSet(options, OPT_PLR);
    }

    boolean allowCreature() {
	return Bit.isSet(options, OPT_CRT);
    }

    abstract void execute(Char aChar, StringTokenizer toker, String cmd, String cmdLine);
}