/**
  * Procédure de passage d'un véhicule, envoie d'un rapport et actualisation des icônes d'états des
  * bornes
  *
  * @param vehicule
  * @throws InterruptedException de passageVehicule()
  */
 public void fairePasserVehicule(VehiculeEvent vehicule) throws InterruptedException {
   _etat = new EtatOuvert();
   Fenetre.majImages();
   passageVehicule();
   envoyerRapport(vehicule);
   _etat = new EtatFerme();
   Fenetre.majImages();
 }
Example #2
0
 @Override
 public void clicNoeud(Fenetre fenetre, Adresse adresse, Plan plan, ListeDeCmd listeCmd) {
   if (adresse.estAssocierAvecLivraison()) {
     if (fenetre.confirmerSuppression()) {
       CmdSupprimer cmd = new CmdSupprimer(adresse.getLivraison(), plan.getTournee());
       listeCmd.ajoute(cmd);
       cmd.doCmd();
       // TODO message de confirmation?
     }
     Controleur.setEtatCourant(Controleur.etatTournee);
     fenetre.ecrireLog(Constants.LOGS_DEFAULT);
   } else {
     fenetre.signalerErreur(Constants.ERR_PAS_ADRESSE_LIVRAISON);
   }
 }
Example #3
0
  // Méthode appelé lors de la création d'une nouvelle partie
  public boolean creerPartie(String nomJoueur, int rows, int cols) {
    System.out.println("My name is " + nomJoueur);
    fenetre.setTailleGrille(rows, cols);
    _managerAnimaux.initialiser(rows, cols);

    ajouterAnimal(Animal.lamasticot, "roger", 'F', 'O', new Point(10, 10));

    /*  ajouterAnimal(Animal.lamasticot, "roger", 'F','O', new Point(16, 4));
    ajouterAnimal(Animal.lion, "roger", 'F','O', new Point(5, 10));
    ajouterAnimal(Animal.lion, "roger", 'F','O', new Point(10, 3));*/

    _managerAnimaux.start();
    return true;
  }
Example #4
0
  // Méthode appelé pour ajouter un nouvel animal
  public boolean ajouterAnimal(Animal animal, String nom, char sexe, char leader, Point position) {
    System.out.println(
        "Animal => "
            + animal.getNom()
            + " : "
            + nom
            + ", "
            + sexe
            + ", "
            + leader
            + ", "
            + position);
    Espece tmpAnimal;
    tmpAnimal = _managerAnimaux.getMonde().ajoutAnimaux(animal, position.x, position.y);
    fenetre.getGrille().ajouterAnimal(tmpAnimal);

    return true;
  }
Example #5
0
 @Override
 public void clicDroit(Fenetre fenetre) {
   Controleur.setEtatCourant(Controleur.etatTournee);
   fenetre.ecrireLog(Constants.LOGS_DEFAULT);
 }