added lab7 ex1
This commit is contained in:
21
src/lab7_state/ex1/MachineState.java
Normal file
21
src/lab7_state/ex1/MachineState.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package lab7_state.ex1;
|
||||
|
||||
public abstract class MachineState {
|
||||
protected Machine machine;
|
||||
|
||||
public MachineState(Machine machine) {
|
||||
this.machine = machine;
|
||||
}
|
||||
|
||||
protected void powerUp() {}
|
||||
protected void insertCoin(double value) {}
|
||||
protected void returnCoin() {}
|
||||
protected void reset() {}
|
||||
protected void pushButton() {}
|
||||
protected void removeCup() {}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user