feat(model): World.combinations field + backward-compatible constructors
This commit is contained in:
@@ -37,15 +37,24 @@ public class World {
|
||||
/** Ordered list of endings (first matching one wins). */
|
||||
private final List<Ending> endings;
|
||||
|
||||
/** Backward-compatible constructor for worlds without quests or endings. */
|
||||
/** Global lookup of combination recipes by canonical pair key. */
|
||||
private final Map<String, Combination> combinations;
|
||||
|
||||
/** Backward-compatible constructor for worlds without quests, endings, or combinations. */
|
||||
public World(Map<String, Room> rooms, Map<String, Item> items, Map<String, Npc> npcs,
|
||||
String title, String welcomeMessage) {
|
||||
this(rooms, items, npcs, title, welcomeMessage, Map.of(), List.of());
|
||||
this(rooms, items, npcs, title, welcomeMessage, Map.of(), List.of(), Map.of());
|
||||
}
|
||||
|
||||
/** Backward-compatible constructor for worlds with quests but no endings. */
|
||||
/** Backward-compatible constructor for worlds with quests but no endings/combinations. */
|
||||
public World(Map<String, Room> rooms, Map<String, Item> items, Map<String, Npc> npcs,
|
||||
String title, String welcomeMessage, Map<String, Quest> quests) {
|
||||
this(rooms, items, npcs, title, welcomeMessage, quests, List.of());
|
||||
this(rooms, items, npcs, title, welcomeMessage, quests, List.of(), Map.of());
|
||||
}
|
||||
|
||||
/** Backward-compatible constructor for worlds with quests + endings but no combinations. */
|
||||
public World(Map<String, Room> rooms, Map<String, Item> items, Map<String, Npc> npcs,
|
||||
String title, String welcomeMessage, Map<String, Quest> quests, List<Ending> endings) {
|
||||
this(rooms, items, npcs, title, welcomeMessage, quests, endings, Map.of());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user