예제 #1
0
  @FXML
  private void IsValide(ActionEvent event) {
    System.out.println("Test IsValide");
    String wordtest = Rword.getText();

    boolean valid = handeller.ValideWord(wordtest, hang.optionword);
    if (valid) {
      boolean trueword = handeller.lookforWord(wordtest);
      int sc = handeller.score(wordtest);
      if (trueword) {
        System.out.println("valide");
        hang.score += sc;
        data.add(wordtest + "   + " + sc);
        int t = handeller.randomimgs();
        System.out.println("t -->" + t);
        Image image = new Image("/resource/imgS/" + t + ".gif");
        img.setImage(image);
        if (handeller.updateOption(wordtest, hang.optionword)) {
          hang.score += 100;
          data.add("END   +  100");
          Reload(event);
        } else {
          Toption.setText(hang.optionword);
        }
      } else {
        System.out.println("Not valide");
        hang.score -= sc;
        data.add(wordtest + "   - " + sc);
        int t = handeller.randomimgf();
        System.out.println("t -->" + t);
        Image image = new Image("/resource/imgF/" + t + ".gif");
        img.setImage(image);
      }
    } else {
      System.out.println("Not valide");
      hang.score -= 10;
      data.add("Out of Scope   - 10");
      Image image = new Image("/resource/out.gif");
      img.setImage(image);
    }
    Tscore.setText("" + hang.score);
    Rword.clear();
  }