CommandDefinition.java
资源名称:src.rar [点击查看]
上传用户:gwt600
上传日期:2021-06-03
资源大小:704k
文件大小:1k
源码类别:
游戏
开发平台:
Java
- //ZreHyMS
- package net.sf.odinms.client.messages;
- public class CommandDefinition {
- private String command;
- private int requiredLevel;
- private String showhelp;
- public CommandDefinition(String command, int requiredLevel, String help) {
- StringBuffer space=new StringBuffer(" ");
- int m=command.split("m").length;
- int M=command.split("M").length;
- for (int x = 0; x < 18-command.length()-m-M; x+=2) {
- space.append(" ");
- }
- if(command.length()%2!=0){
- space.append(" ");
- }
- String sp=space.toString();
- this.command = command.replaceAll(" ", "");
- this.requiredLevel = requiredLevel;
- showhelp = command.replaceAll(" ", "").toLowerCase()+sp+help;
- }
- public CommandDefinition(String command, int requiredLevel) {
- this.command = command.replaceAll(" ", "");
- this.requiredLevel = requiredLevel;
- showhelp=command.replaceAll(" ", "").toLowerCase();
- }
- public String getCommand() {
- return command;
- }
- public String showHelp() {
- return showhelp;
- }
- public int getRequiredLevel() {
- return requiredLevel;
- }
- }