This repository has been archived on 2022-12-21. You can view files and clone it, but cannot push or open issues or pull requests.
sdm03/src/main/java/com/github/dtschust/zork/types/ZorkItem.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);
}
}