Exemplo n.º 1
0
 public void remove(String name) {
   if (!StringUtils.isEmpty(name)) {
     String funName = name.trim().toLowerCase();
     _system_functs.remove(funName);
     _rocFunctions.remove(funName);
   }
 }
Exemplo n.º 2
0
 /**
  * 添加自定义函数到脚本中
  *
  * @param name
  * @param rfunction
  */
 public void add(String name, IRocFunction rfunction) {
   if (!StringUtils.isEmpty(name)) {
     String funName = name.trim().toLowerCase();
     _system_functs.add(funName);
     _rocFunctions.put(funName, rfunction);
   }
 }
Exemplo n.º 3
0
  public void load3ds(String filename, int count, float angle_y, float z_adjust, float scale) {
    if (meshCache.get(filename + ("" + angle_y) + count) == null) {
      ArrayByte is = BaseIO.loadArrayByte(filename);
      byte buffer[] = new byte[is.available()];
      is.read(buffer);
      this.mMeshPosition = new float[3];
      currentcount = 0;
      eatChunk(buffer, 0, count, angle_y, z_adjust, scale);
      is.close();
      this.mMeshName = filename;
      this.mMeshPosition = null;
      D3DMesh.storeMesh(filename + ("" + angle_y) + count, this);

    } else {
      this.copyReference(D3DMesh.getMesh(filename + ("" + angle_y) + count));
    }
  }
Exemplo n.º 4
0
 public Object getValue(RocScript script, String name, String value) {
   if (name == null) {
     return value;
   }
   String key = name.trim().toLowerCase();
   if ("trim".equals(key)) {
     if (value.indexOf(",") == -1) {
       return StringUtils.trim(value);
     }
   } else if ("rtrim".equals(key)) {
     if (value.indexOf(",") == -1) {
       return StringUtils.rtrim(value);
     }
   } else if ("isnan".equals(key)) {
     if (value.indexOf(",") == -1) {
       return MathUtils.isNan(value);
     }
   } else if ("ischinese".equals(key)) {
     if (value.indexOf(",") == -1) {
       return StringUtils.isChinaLanguage(value);
     }
   } else if ("indexof".equals(key)) {
     if (value.indexOf(",") != -1) {
       String[] split = StringUtils.split(value, ',');
       if (split.length == 2) {
         return split[0].indexOf(split[1]) != -1;
       }
     }
   } else if ("jump".equals(key)) {
     script._sleep = JUMP_TYPE;
   }
   IRocFunction roc = (IRocFunction) _rocFunctions.get(key);
   if (roc != null) {
     String[] args = StringUtils.split(value, ',');
     Object o = roc.call(args);
     if (o != null) {
       return o;
     }
   }
   return name;
 }
Exemplo n.º 5
0
 public static D3DMesh getMesh(String name) {
   return (D3DMesh) meshCache.get(name);
 }