Beispiel #1
0
  private String rtsNewScope(GameModel gameModel) {
    List<VariableDescriptor> variableDescriptors = gameModel.getVariableDescriptors();
    StringBuilder sb = new StringBuilder();
    sb.append("[");

    for (Iterator<VariableDescriptor> it = variableDescriptors.iterator(); it.hasNext(); ) {
      VariableDescriptor vd = it.next();
      if ("question".equals(vd.getLabel().toLowerCase())) {
        if (!(vd.getScope() instanceof GameModelScope)) {
          sb.append(this.newScope(gameModel, vd));
        }
      } else if ("toolbar".equals(vd.getLabel().toLowerCase())
          || "moves".equals(vd.getLabel().toLowerCase())
          || "dialogues".equals(vd.getLabel().toLowerCase())) {
        if (vd instanceof ListDescriptor) {
          ListDescriptor list = (ListDescriptor) vd;
          for (VariableDescriptor child : list.getItems()) {
            if (child instanceof StringDescriptor) {
              sb.append(this.newScope(gameModel, child));
            }
          }
        }
      }
    }
    sb.append("]");

    return sb.toString();
  }
Beispiel #2
0
  private String rtsUpdateScope(GameModel gameModel) {
    List<VariableDescriptor> variableDescriptors = gameModel.getVariableDescriptors();
    StringBuilder sb = new StringBuilder();
    sb.append("[");

    for (VariableDescriptor vd : variableDescriptors) {

      if ("question".equals(vd.getLabel().toLowerCase())) {
        this.updateScope(vd);
      } else if ("toolbar".equals(vd.getLabel().toLowerCase())
          || "moves".equals(vd.getLabel().toLowerCase())
          || "dialogues".equals(vd.getLabel().toLowerCase())) {
        if (vd instanceof ListDescriptor) {
          ListDescriptor list = (ListDescriptor) vd;
          for (VariableDescriptor child : list.getItems()) {
            if (child instanceof StringDescriptor) {
              this.updateScope(child);
            }
          }
        }
      }
    }
    sb.append("]");

    return sb.toString();
  }
Beispiel #3
0
  private String lawUpdateScope(GameModel gameModel) {
    this.updateListDescriptorScope(gameModel);
    StringBuilder sb = new StringBuilder();
    try {
      sb.append("[");

      ListDescriptor etapes =
          (ListDescriptor) VariableDescriptorFacade.lookup().find(gameModel, "etapes");
      for (VariableDescriptor item : etapes.getItems()) {
        this.updateScope(item);
      }

      sb.append("]");

    } catch (WegasNoResultException ex) {
      java.util.logging.Logger.getLogger(UpdateController.class.getName())
          .log(Level.SEVERE, null, ex);
    }
    return sb.toString();
  }