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/ZorkRoom.java

39 lines
1.1 KiB
Java
Raw Normal View History

2022-11-19 09:46:28 +00:00
package com.github.dtschust.zork.types;
import com.github.dtschust.zork.Zork;
import java.util.HashMap;
2022-11-19 07:48:21 +00:00
import java.util.HashSet;
import java.util.Map;
2022-11-19 07:48:21 +00:00
import java.util.Set;
/* Room*/
public class ZorkRoom extends ZorkObject implements HasSetOfCollectable {
public final String type;
public final Map<String, String> border = new HashMap<>();
public final Set<String> container = new HashSet<>();
public final Set<String> item = new HashSet<>();
public final Set<String> creature = new HashSet<>();
public ZorkRoom(final String name,
final String description,
final String type) {
super(name, description);
this.type = type;
}
@Override
public Set<String> getSetFromType(Zork.Type type) {
switch (type) {
case CONTAINER:
return container;
case CREATURE:
return creature;
case ITEM:
return item;
default:
throw new IllegalStateException("Unexpected value: " + type);
}
}
}