This commit is contained in:
Janis M
2022-05-02 11:58:32 +02:00
parent fbcc1a7371
commit aa89da7ce9
36 changed files with 1533 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
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());
}
}
}