mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-29 20:42:11 +01:00
6
This commit is contained in:
23
src/nogard/schritt6/commands/CommandPut.java
Normal file
23
src/nogard/schritt6/commands/CommandPut.java
Normal 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user