-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFacade.java
More file actions
31 lines (24 loc) · 1016 Bytes
/
Facade.java
File metadata and controls
31 lines (24 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public class Facade {
Combustible combustible = new Combustible();
EstadoMotor estadoMotor = new EstadoMotor();
Posicion posicion = new Posicion();
Falcon9 falconNine = new Falcon9(combustible, posicion, estadoMotor);
boolean combustibleListo = falconNine.gCombustible().verificarEstadoCombustible();
boolean motorListo = falconNine.gEstadoMotor().verificarEstado();
boolean posicionCorrecta = falconNine.gPosicion().verificarInclinacion();
public void estadoFalconNine() {
if (combustibleListo && motorListo && posicionCorrecta) {
despegar();
} else {
abortar();
}
}
public void despegar() {
System.out.println("Motores y combustible listos para el despegue.");
}
public void abortar() {
System.out.println("Estado combustible: " + combustibleListo);
System.out.println("Estado motores: " + motorListo);
System.out.println("Estado posición: " + posicionCorrecta);
}
}