34 lines
990 B
Java
34 lines
990 B
Java
package com.github.dtschust.zork.types;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* Item*/
|
|
public class ZorkItem extends ZorkObject implements HasPrintsAndActions {
|
|
public final String writing;
|
|
private final List<String> turnOnPrint;
|
|
private final List<String> turnOnAction;
|
|
|
|
public ZorkItem(final String name,
|
|
final String description,
|
|
final String writing,
|
|
final List<String> turnOnPrint,
|
|
final List<String> turnOnAction) {
|
|
super(name, description);
|
|
this.writing = writing;
|
|
this.turnOnPrint = new ArrayList<>(turnOnPrint);
|
|
this.turnOnAction = new ArrayList<>(turnOnAction);
|
|
}
|
|
|
|
@Override
|
|
public List<String> getPrints() {
|
|
return Collections.unmodifiableList(turnOnPrint);
|
|
}
|
|
|
|
@Override
|
|
public List<String> getActions() {
|
|
return Collections.unmodifiableList(turnOnAction);
|
|
}
|
|
}
|