mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added an ability to show puzzle descriptions on the puzzle goal card.
This commit is contained in:
@@ -20,6 +20,7 @@ public class Puzzle extends GameState implements InventoryItem, Comparable {
|
||||
String goal;
|
||||
String url;
|
||||
String difficulty;
|
||||
String description;
|
||||
int turns;
|
||||
|
||||
public Puzzle(Map<String, List<String>> puzzleLines) {
|
||||
@@ -41,6 +42,8 @@ public class Puzzle extends GameState implements InventoryItem, Comparable {
|
||||
this.turns = Integer.parseInt(split[1]);
|
||||
} else if ("Difficulty".equalsIgnoreCase(split[0])) {
|
||||
this.difficulty = split[1];
|
||||
} else if ("Description".equalsIgnoreCase(split[0])) {
|
||||
this.description = split[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +64,11 @@ public class Puzzle extends GameState implements InventoryItem, Comparable {
|
||||
desc.append("\nTurns Limit: ");
|
||||
desc.append(this.turns);
|
||||
|
||||
if (this.description != null) {
|
||||
desc.append("\n\n");
|
||||
desc.append(this.description);
|
||||
}
|
||||
|
||||
return desc.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class PuzzleIO {
|
||||
|
||||
public static ArrayList<Puzzle> loadPuzzles() {
|
||||
String[] pList;
|
||||
// get list of custom draft files
|
||||
// get list of puzzles
|
||||
final File pFolder = new File(ForgeConstants.PUZZLE_DIR);
|
||||
if (!pFolder.exists()) {
|
||||
throw new RuntimeException("Puzzles : folder not found -- folder is " + pFolder.getAbsolutePath());
|
||||
|
||||
Reference in New Issue
Block a user