示例#1
0
  public ReplaceArea(tiled.core.MapObject obj) {
    //		String requireType = obj.getProperties().getProperty("requireType");
    String requireId = obj.getProperties().getProperty("requireId");
    String requireValue = obj.getProperties().getProperty("requireValue");
    if (requireId == null) {
      String[] fields = obj.getName().split(":");
      if (fields.length == 2) {
        //				requireType = Requirement.RequirementType.questProgress.toString();
        requireValue = fields[1];
        requireId = fields[0];
      } /*else if (fields.length == 3) {
        	requireValue = fields[2];
        	requireType = fields[0];
        	requireId = fields[1];
        }*/
      oldSchoolRequirement = true;
    } else {
      oldSchoolRequirement = false;
    }
    requirement = new Requirement();
    // Replace areas only support questProgress requirements ATM
    // requirement.type = Requirement.RequirementType.valueOf(requireType);
    requirement.type = Requirement.RequirementType.questProgress;
    requirement.required_obj_id = requireId;
    if (requireValue != null) requirement.required_value = Integer.parseInt(requireValue);
    requirement.state = GameDataElement.State.parsed;

    for (Object s : obj.getProperties().keySet()) {
      if (replacements == null) replacements = new LinkedList<ReplaceArea.Replacement>();
      replacements.add(
          new Replacement(s.toString(), obj.getProperties().getProperty(s.toString())));
    }
  }
示例#2
0
 @Override
 public void elementChanged(GameDataElement oldOne, GameDataElement newOne) {
   requirement.elementChanged(oldOne, newOne);
 }
示例#3
0
 @Override
 public void link() {
   requirement.parent = parentMap;
   requirement.link();
 }