Esempio n. 1
0
 /** Routine graphique lorsque la commande Action est appuyé */
 public void IhmActionAppuyé() {
   ihmjeu.getCommande2().setVisible(false);
   ihmjeu.remove(ihmjeu.getCommande2());
   ihmjeu.setCommande3(
       new IHMCommandeVue3(personnageSelectionné, ihmjeu, this, getJoueurCourant()));
   ihmjeu.getContentPane().add(ihmjeu.getCommande3(), BorderLayout.SOUTH);
   ihmjeu.afficherTerminal("Selectionner une Action");
   this.setPhase(Phase.ACTION_PERSONNAGE);
 }
Esempio n. 2
0
 /** Routine graphique de la fin d'une Action */
 public void IhmFinAction() {
   ihmjeu.getCommande3().setVisible(false);
   ihmjeu.remove(ihmjeu.getCommande3());
   ihmjeu.getCommande2().setVisible(true);
   ihmjeu.getContentPane().add(ihmjeu.getCommande2(), BorderLayout.SOUTH);
   if (tour.isMultipleAction() && !tour.finMultipleAction())
     ihmjeu.getCommande2().actionMultiple();
   ihmjeu.afficherTerminal("Selectionner une Commande");
   this.setPhase(Phase.NORMAL);
 }
Esempio n. 3
0
 /** Routine graphique de la fin du Tour */
 public void IhmFinTour() {
   ihmjeu
       .getGuiCase(personnageSelectionné.getPosition())
       .setBackground(getJoueurCourant().getColor());
   this.finTour();
   ihmjeu.getCommande2().setVisible(false);
   ihmjeu.remove(ihmjeu.getCommande2());
   ihmjeu.setCommande2(new IHMCommandeVue2(ihmjeu, this));
   ihmjeu.getContentPane().add(ihmjeu.getCommande2(), BorderLayout.SOUTH);
   ihmjeu.afficherTerminal("Selectionner un Personnage");
   this.setPhase(Phase.SELECTION_PERSONNAGE);
 }
Esempio n. 4
0
  /** Routine graphique pour le placement des personnages */
  public void IhmPlacementPersonnage() {
    try {
      this.placerPersonnage(
          getJoueurCourant(), IdPersonnageSelectionné, this.positionCaseSelectionné);
      this.IhmFinVoirCasePossiblePlacement();
      ihmjeu.getCommande1().placementReussi(IdPersonnageSelectionné);
      ihmjeu.getCommande1().boutonActive(IdPersonnageSelectionné);
    } catch (CaseNonVide e) {
      JOptionPane.showMessageDialog(
          null, "La case n'est pas vide", e.toString(), JOptionPane.ERROR_MESSAGE);

    } catch (CaseAdverse e) {
      JOptionPane.showMessageDialog(
          null,
          "La case selectionné est dans le champs adverse",
          e.toString(),
          JOptionPane.ERROR_MESSAGE);
    }

    if (_countjoueur < 1 && ihmjeu.getCommande1().finPlacement()) {
      _countjoueur++;
      ihmjeu.remove(ihmjeu.getCommande1());
      this.joueurSuivant();
      ihmjeu.setCommande1(new IHMCommandeVue1(this, getJoueurCourant()));
      ihmjeu.getContentPane().add(ihmjeu.getCommande1(), BorderLayout.SOUTH);
      ihmjeu.afficherTerminal(
          "Joueur "
              + this.getJoueurCourant().getNom()
              + " : Placer vos personnages sur le plateau");

    } else if (_countjoueur == 1 && ihmjeu.getCommande1().finPlacement()) {
      this.hasPlacé();
      this.joueurSuivant();
      this.setPhase(Phase.SELECTION_PERSONNAGE);
      ihmjeu.remove(ihmjeu.getCommande1());
      ihmjeu.setCommande2(new IHMCommandeVue2(ihmjeu, this));
      ihmjeu.getContentPane().add(ihmjeu.getCommande2(), BorderLayout.SOUTH);
      ihmjeu.afficherTerminal("Selectionner un Personnage");
    }
  }