mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-29 12:32:12 +01:00
24 lines
612 B
Java
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());
|
|
}
|
|
}
|
|
}
|