39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
package com.github.dtschust.zork.types;
|
|
|
|
import com.github.dtschust.zork.ZorkTrigger;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
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 status,
|
|
final String writing,
|
|
final Collection<ZorkTrigger> triggers,
|
|
final Collection<String> turnOnPrint,
|
|
final Collection<String> turnOnAction) {
|
|
super(name, description, status, triggers);
|
|
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);
|
|
}
|
|
}
|