예제 #1
0
 /**
  * Gets a parameter string.
  *
  * @see dungeonCrawler.GameElement#getString()
  */
 @Override
 public String getString() {
   String sep = LevelLoader.getSplitChar();
   return (getName()
       + sep
       + id
       + sep
       + position.getX()
       + sep
       + position.getY()
       + sep
       + size.getX()
       + sep
       + size.getY()
       + sep
       + target.getX()
       + sep
       + target.getY());
 }
예제 #2
0
 /**
  * Modifies parameters.
  *
  * @param param as {@link String[]}
  */
 public void modify(String[] param) {
   Vector2d position = new Vector2d();
   Vector2d size = new Vector2d();
   Vector2d target = new Vector2d();
   try {
     int i = (param.length > 7 ? 1 : 0);
     position.setX(Integer.parseInt(param[i + 1]));
     position.setY(Integer.parseInt(param[i + 2]));
     size.setX(Integer.parseInt(param[i + 3]));
     size.setY(Integer.parseInt(param[i + 4]));
     target.setX(Integer.parseInt(param[i + 5]));
     target.setY(Integer.parseInt(param[i + 6]));
     element.setPosition(position);
     element.setSize(size);
     element.setTarget(target);
     element.gei.setSize(size);
   } catch (NumberFormatException e) {
     System.out.println("Kann WARPPOINT-Parameter nicht interpretieren.");
     element = null;
   }
 }