Files
lf05-java/src/nogard/schritt6/commands/CommandPut.java
Janis M aa89da7ce9 6
2022-05-02 11:58:32 +02:00

24 lines
612 B
Java

package nogard.schritt6.commands;
import nogard.schritt6b.Spieler;
import nogard.schritt6b.exceptions.GegenstandNichtVorhandenException;
public class CommandPut implements ICommand {
private Spieler spieler;
private String gegenstand;
public CommandPut(Spieler spieler, String gegenstand) {
this.spieler = spieler;
this.gegenstand = gegenstand;
}
@Override
public void execute() {
try {
spieler.ablegenGegenstand(gegenstand);
} catch (GegenstandNichtVorhandenException e) {
System.out.println(e.getMessage());
}
}
}