You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB

package model;
// package tetepremiere.commande.groupe;
public class ChargeurTelecommande {
public static void main(String[] args) {
Telecommande remoteControl = new Telecommande();
Lampe lampe = new Lampe("Séjour");
TV tv = new TV("Séjour");
Stereo stereo = new Stereo("Séjour");
Jacuzzi jacuzzi = new Jacuzzi();
CommandeAllumerLampe lampeAllumee = new CommandeAllumerLampe(lampe);
CommandeAllumerStereo stereoAllumee = new CommandeAllumerStereo(stereo);
CommandeAllumerTV tvAllumee = new CommandeAllumerTV(tv);
CommandeAllumerJacuzzi jacuzziAllume = new CommandeAllumerJacuzzi(jacuzzi);
CommandeEteindreLampe lampeEteinte = new CommandeEteindreLampe(lampe);
CommandeEteindreStereo stereoEteinte = new CommandeEteindreStereo(stereo);
CommandeEteindreTV tvEteinte = new CommandeEteindreTV(tv);
CommandeEteindreJacuzzi jacuzziEteint = new CommandeEteindreJacuzzi(jacuzzi);
Commande[] allumageGroupe = { lampeAllumee, stereoAllumee, tvAllumee, jacuzziAllume};
Commande[] extinctionGroupe = { lampeEteinte, stereoEteinte, tvEteinte, jacuzziEteint};
MacroCommande macroAllumageGroupe = new MacroCommande(allumageGroupe);
MacroCommande macroExtinctionGroupe = new MacroCommande(extinctionGroupe);
remoteControl.setCommande(0, macroAllumageGroupe, macroExtinctionGroupe);
System.out.println(remoteControl);
System.out.println("---Exécution de Macro Marche ---");
remoteControl.boutonMarchePresse(0);
System.out.println("--- Exécution de Macro Arret ---");
remoteControl.boutonArretPresse(0);
}
}