mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
does not force deck to have comment or playerType
This commit is contained in:
@@ -26,8 +26,8 @@ public final class Deck implements Comparable<Deck>, Serializable {
|
|||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String deckType;
|
private String deckType;
|
||||||
private String comment;
|
private String comment = null;
|
||||||
private PlayerType playerType;
|
private PlayerType playerType = null;
|
||||||
|
|
||||||
private CardPool main;
|
private CardPool main;
|
||||||
private CardPool sideboard;
|
private CardPool sideboard;
|
||||||
@@ -152,7 +152,7 @@ public final class Deck implements Comparable<Deck>, Serializable {
|
|||||||
* @return a {@link java.lang.String} object.
|
* @return a {@link java.lang.String} object.
|
||||||
*/
|
*/
|
||||||
public String getComment() {
|
public String getComment() {
|
||||||
return comment == null ? "" : comment;
|
return comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -463,14 +463,14 @@ public class DeckManager {
|
|||||||
* @param out a {@link java.io.BufferedWriter} object.
|
* @param out a {@link java.io.BufferedWriter} object.
|
||||||
* @throws java.io.IOException if any.
|
* @throws java.io.IOException if any.
|
||||||
*/
|
*/
|
||||||
private static void writeDeck(Deck d, BufferedWriter out) throws IOException {
|
private static void writeDeck(final Deck d, final BufferedWriter out) throws IOException {
|
||||||
out.write("[metadata]\n");
|
out.write("[metadata]\n");
|
||||||
|
|
||||||
|
|
||||||
out.write(format("%s=%s%n", NAME, d.getName().replaceAll("\n", "")));
|
out.write(format("%s=%s%n", NAME, d.getName().replaceAll("\n", "")));
|
||||||
out.write(format("%s=%s%n", DECK_TYPE, d.getDeckType().replaceAll("\n", "")));
|
out.write(format("%s=%s%n", DECK_TYPE, d.getDeckType().replaceAll("\n", "")));
|
||||||
out.write(format("%s=%s%n", COMMENT, d.getComment().replaceAll("\n", "")));
|
// these are optional
|
||||||
out.write(format("%s=%s%n", PLAYER, d.getPlayerType()));
|
if (d.getComment() != null) { out.write(format("%s=%s%n", COMMENT, d.getComment().replaceAll("\n", ""))); }
|
||||||
|
if (d.getPlayerType() != null) { out.write(format("%s=%s%n", PLAYER, d.getPlayerType())); }
|
||||||
|
|
||||||
out.write(format("%s%n", "[main]"));
|
out.write(format("%s%n", "[main]"));
|
||||||
for (Entry<CardPrinted, Integer> e : d.getMain()) {
|
for (Entry<CardPrinted, Integer> e : d.getMain()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user